From fcb70831d4d012aaa033c65d7d57e0a6355ba4d6 Mon Sep 17 00:00:00 2001 From: Bilal Syed Hussain Date: Fri, 10 Apr 2015 17:04:54 +0100 Subject: [PATCH] settings --- .nvimrc | 89 ++++++++++++++++++++++++++++++++++++++++----------------- .zshrc | 3 +- 2 files changed, 64 insertions(+), 28 deletions(-) diff --git a/.nvimrc b/.nvimrc index 7f4c81e..16ba998 100644 --- a/.nvimrc +++ b/.nvimrc @@ -1,32 +1,42 @@ call plug#begin('~/.nvim/plugged') " Make sure you use single quotes + Plug 'benekastah/neomake' + Plug 'vim-scripts/wombat256.vim' +Plug 'bling/vim-airline' " On-demand loading Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' } -Plug 'kien/ctrlp.vim' Plug 'ervandew/supertab' Plug 'Shougo/neocomplcache' + +Plug 'Shougo/unite.vim' +Plug 'mileszs/ack.vim' + Plug 'tpope/vim-surround' Plug 'tpope/vim-endwise' Plug 'tpope/vim-repeat' Plug 'tpope/vim-unimpaired' -Plug 'mileszs/ack.vim' -Plug 'bling/vim-airline' +Plug 'tpope/vim-commentary' + +Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': 'yes \| ./install' } + + +Plug '~/.vim/bundle/essence' + call plug#end() -" Syntax checking +" Syntax checking autocmd! BufWritePost * Neomake - " Color scheme colorscheme wombat256mod -" Allow mouse use +" Allow mouse use set mouse=a " Don't show mode changes @@ -93,7 +103,7 @@ set wildmode=list:longest,full set laststatus=2 " Use Cedilla ¸ as the trailing whitespace char -set listchars=tab:‣\ ,trail:¸ +set listchars=tab:‣\ ,trail:¸ set list " Pressing ,ss will toggle and untoggle spell checking @@ -112,9 +122,35 @@ noremap k noremap j noremap l -noremap °;133 :tabprevious -noremap °;134 :tabnext - +" CMD-' CMD-\ +noremap °;133 :bprev +noremap °;134 :bnext + +" buffers list +let g:airline#extensions#tabline#enabled=1 +let g:airline#extensions#tabline#buffer_idx_mode = 1 +let g:airline#extensions#tabline#show_close_button = 1 +let g:airline#extensions#tabline#close_symbol = 'X' + + +nmap 1 AirlineSelectTab1 +nmap 2 AirlineSelectTab2 +nmap 3 AirlineSelectTab3 +nmap 4 AirlineSelectTab4 +nmap 5 AirlineSelectTab5 +nmap 6 AirlineSelectTab6 +nmap 7 AirlineSelectTab7 +nmap 8 AirlineSelectTab8 +nmap 9 AirlineSelectTab9 + +" allow unsaved +set hidden + +" Vim jump to the last position when reopening a file +if has("autocmd") + au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") + \| exe "normal! g'\"" | endif +endif " Disable highlight when is pressed " but preserve cursor coloring @@ -133,25 +169,24 @@ set pastetoggle= autocmd BufRead,BufNewFile *.py set tabstop=4 shiftwidth=4 softtabstop=4 autocmd BufRead,BufNewFile *.rb set noexpandtab tabstop=2 shiftwidth=2 -" Fuzzy find files -nnoremap :CtrlP -let g:ctrlp_max_files=0 - -let g:ctrlp_user_command = { - \ 'types': { - \ 1: ['.git', 'cd %s && git ls-files --cached --exclude-standard --others'], - \ 2: ['.hg', 'hg --cwd %s locate -I .'], - \ }, - \ 'fallback': 'find %s -type f', - \ } - -" Ignore some folders and files for CtrlP indexing -let g:ctrlp_custom_ignore = { - \ 'dir': '\.git$\|\.sass-cache$|\.hg$\|\.svn$\|\.yardoc\|public$|log\|tmp$|smac*', - \ 'file': '\.so$\|\.dat$|\.DS_Store$' - \ } +" Delete trailing white space on save +func! DeleteTrailingWS() + exe "normal mz" + %s/\s\+$//ge + exe "normal `z" +endfunc + +augroup whitespace + autocmd! + autocmd BufWrite * :call DeleteTrailingWS() +augroup END + +" Fuzzy find files +" nnoremap :Unite file_rec/neovim +nnoremap :FZF + if !exists('g:airline_symbols') let g:airline_symbols = {} endif diff --git a/.zshrc b/.zshrc index bf8e150..cee92e3 100644 --- a/.zshrc +++ b/.zshrc @@ -242,4 +242,5 @@ autoload -U +X bashcompinit && bashcompinit [ -f /Users/bilalh/CS/gen/hs/scripts/_gen.sh ] && source /Users/bilalh/CS/gen/hs/scripts/_gen.sh -[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +# [ -f ~/.fzf.zsh ] && source ~/.fzf.zsh +unset GREP_OPTIONS