diff options
Diffstat (limited to 'plugin')
| -rw-r--r-- | plugin/airline.vim | 15 | ||||
| -rw-r--r-- | plugin/basics.vim | 49 | ||||
| -rw-r--r-- | plugin/ctrlp.vim | 2 | ||||
| -rw-r--r-- | plugin/filetype-options.vim | 98 | ||||
| -rw-r--r-- | plugin/gundo.vim | 1 | ||||
| -rw-r--r-- | plugin/rebinds.vim | 14 | ||||
| -rw-r--r-- | plugin/undo.vim | 10 |
7 files changed, 189 insertions, 0 deletions
diff --git a/plugin/airline.vim b/plugin/airline.vim new file mode 100644 index 0000000..4486d50 --- /dev/null +++ b/plugin/airline.vim @@ -0,0 +1,15 @@ +" Always show status line +" set laststatus=2 + +" Enable the list of buffers +let g:airline#extensions#tabline#enabled = 1 + +" Show just the filename +let g:airline#extensions#tabline#fnamemod = ':t' + +if !exists('g:airline_symbols') + let g:airline_symbols = {} +endif +let g:airline_symbols.space = "\ua0" + +let g:airline_section_z = airline#section#create(['windowswap', '%3p%% ', 'linenr', ':%3v']) diff --git a/plugin/basics.vim b/plugin/basics.vim new file mode 100644 index 0000000..1ac112a --- /dev/null +++ b/plugin/basics.vim @@ -0,0 +1,49 @@ +" Basic vimrc for systems you don't want to copy the full one to +set encoding=utf-8 " The encoding displayed. +set fileencoding=utf-8 " The encoding written to file. +set background=dark " Since most terminals I have dark backgrounds +set nu " Line 'nu'mbers +set listchars=tab:▸\ ,eol:¬,trail:• " Listchars are used to show normally + " invisible chars such as tabs, EOL and + " trailing whitespace +" set listchars=tab:\|\ " Alternative listchars w/o special chars. +set colorcolumn=80 " Sets a "coloured" coloumn to tell you where your line + " breaks should be so you don't piss off people using + " a terminal. +set ic " Case insensitive search by default +set hls " Highlight my searches by default +set updatecount=0 " Do not write swap files +set nocompatible " Don't be compatbile with 'vi' +set tabstop=4 " Tab width +set shiftwidth=4 +set noexpandtab " Do **NOT** turn tabs into spaces by default +" Be smart about the mouse +set mouse+=a +if &term =~ '^screen' + " tmux knows the extended mouse mode + set ttymouse=xterm2 +endif +syntax on " Syntax highlighting by default + + +set nomodeline " I know how to setup my editor, I don't need your + " changes to my vim configuration. + +" Use \-n in normal mode to toggle line numbers +nmap <leader>n :set invnu<CR> +" Use \-l in normal mode to toggle listchars +nmap <leader>l :set list!<CR> + +" Use \-s to pop open a spelling menu. use ]s to search forwards and [s to go +" backwards. +" Apparently this also doesn't work if spell checking isn't enabled +" at the time you enable it. +set spell +nnoremap \s ea<C-X><C-S> +set nospell + +" set hidden " This will allow you to change buffers w/o saving + +" Omni completion, c-x c-o in insert/append mode +" filetype plugin on +" set omnifunc=syntaxcomplete#Complete diff --git a/plugin/ctrlp.vim b/plugin/ctrlp.vim new file mode 100644 index 0000000..515a5d2 --- /dev/null +++ b/plugin/ctrlp.vim @@ -0,0 +1,2 @@ +let g:ctrlp_follow_symlinks = 1 +let g:ctrlp_working_path_mode = 0 diff --git a/plugin/filetype-options.vim b/plugin/filetype-options.vim new file mode 100644 index 0000000..f0cbb37 --- /dev/null +++ b/plugin/filetype-options.vim @@ -0,0 +1,98 @@ +function! PhpSyntaxOverride() + hi! def link phpDocTags phpDefine + hi! def link phpDocParam phpType +endfunction + +augroup phpSyntaxOverride + autocmd! + autocmd FileType php call PhpSyntaxOverride() +augroup END + +" This is specifically for Salt's state files 'sls' +autocmd BufNewFile,BufRead *.sls set filetype=yaml + +autocmd Filetype python call SetPythonOptions() +autocmd Filetype htmldjango call SethtmldjangoOptions() +autocmd Filetype json call SetJsonOptions() +autocmd Filetype javascript call SetjavascriptOptions() +autocmd Filetype php call SetPHPOptions() +autocmd Filetype html call SetHTMLOptions() +autocmd Filetype sh call SetShellOptions() +autocmd Filetype go call SetGoOptions() +autocmd Filetype yaml call SetYamlOptions() +autocmd Filetype markdown call SetMarkdownOptions() + +function SetMarkdownOptions() + set spell + set tabstop=2 + set shiftwidth=2 + set expandtab + AcpDisable +endfunction +function SetPythonOptions() + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetjavascriptOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetJsonOptions() + set tabstop=3 + set shiftwidth=3 + set expandtab + filetype indent on + set smartindent +endfunction +function SethtmldjangoOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetPHPOptions() + set colorcolumn=120 + set tabstop=4 + set shiftwidth=4 + set expandtab + filetype indent on + set smartindent +endfunction +function SetHTMLOptions() + set colorcolumn=120 + set tabstop=2 + set shiftwidth=2 + set expandtab + filetype indent on + set smartindent +endfunction +function SetShellOptions() + set tabstop=8 + set shiftwidth=8 + set noexpandtab + filetype indent on + set smartindent +endfunction +function SetGoOptions() + set tabstop=8 + set noexpandtab + " The ACP is pretty slow with my Go plugins enabled + AcpDisable + set nolist + set noic + set nolist +endfunction +function SetYamlOptions() + set tabstop=2 + set shiftwidth=2 + set expandtab + set expandtab + set noic +endfunction diff --git a/plugin/gundo.vim b/plugin/gundo.vim new file mode 100644 index 0000000..bdcb82a --- /dev/null +++ b/plugin/gundo.vim @@ -0,0 +1 @@ +let g:gundo_prefer_python3 = 1 diff --git a/plugin/rebinds.vim b/plugin/rebinds.vim new file mode 100644 index 0000000..cacef62 --- /dev/null +++ b/plugin/rebinds.vim @@ -0,0 +1,14 @@ +" Keep the newbs from using arrow keys +inoremap <Left> <NOP> +inoremap <Right> <NOP> +inoremap <Up> <NOP> +inoremap <Down> <NOP> + +" map <C-n> :Lex<CR> +map <C-n> :NERDTreeToggle<CR> + +" To enable/disable the autocomplete dropdown +nmap <leader> [ :AcpDisable<CR> +nmap <leader> ] :AcpEnable<CR> + +nnoremap <F5> :GundoToggle<CR> diff --git a/plugin/undo.vim b/plugin/undo.vim new file mode 100644 index 0000000..78c7e48 --- /dev/null +++ b/plugin/undo.vim @@ -0,0 +1,10 @@ +" Persistent undo +set undofile +set undodir=~/.vimundo +set undolevels=1000 +set undoreload=10000 + +" lots of history, it's always nice to find old nasty command that happen +" to be really useful +set history=10000 +" |
