diff options
author | neodarz <neodarz@neodarz.net> | 2017-09-07 22:17:49 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2017-09-07 22:17:49 +0200 |
commit | 53d39a584c847d84c6f9ba7ec1303442503a7329 (patch) | |
tree | a6c9480d0495785d94404bf1a220d5958274196a /nvim | |
parent | 5283bdc1939d9c2004e900869db85dc9d757335c (diff) | |
download | dotfiles_ascii-53d39a584c847d84c6f9ba7ec1303442503a7329.tar.xz dotfiles_ascii-53d39a584c847d84c6f9ba7ec1303442503a7329.zip |
Add nvim conf
Diffstat (limited to '')
-rw-r--r-- | nvim/.config/nvim/init.vim | 124 |
1 files changed, 124 insertions, 0 deletions
diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim new file mode 100644 index 0000000..1bc22c8 --- /dev/null +++ b/nvim/.config/nvim/init.vim @@ -0,0 +1,124 @@ +""""""" Plugin management stuff """"""" +set nocompatible +filetype off + +set rtp+=~/.config/nvim/bundle/Vundle.vim +call vundle#begin('~/.config/nvim/bundle') + +Plugin 'VundleVim/Vundle.vim' + +" Custom plugins... +" EasyMotion - Allows <leader><leader>(b|e) to jump to (b)eginning or (end) +" of words. +"Plugin 'easymotion/vim-easymotion' +" Ctrl-P - Fuzzy file search +"Plugin 'kien/ctrlp.vim' +" Neomake build tool (mapped below to <c-b>) +Plugin 'benekastah/neomake' +" Autocomplete for python +"Plugin 'davidhalter/jedi-vim' +" Remove extraneous whitespace when edit mode is exited +"Plugin 'thirtythreeforty/lessspace.vim' + +" Screen splitter. Cool, but doesn't work with nvim. +"Plugin 'ervandew/screen' + +" LaTeX editing +Plugin 'LaTeX-Box-Team/LaTeX-Box' + +" Status bar mods +Plugin 'bling/vim-airline' +Plugin 'airblade/vim-gitgutter' + +" Tab completion +Plugin 'ervandew/supertab' + +Plugin 'sirtaj/vim-openscad' + +" After all plugins... +call vundle#end() +filetype plugin indent on + +""""""" Jedi-VIM """"""" +" Don't mess up undo history +"let g:jedi#show_call_signatures = "0" + + +""""""" SuperTab configuration """"""" +"let g:SuperTabDefaultCompletionType = "<c-x><c-u>" +function! Completefunc(findstart, base) + return "\<c-x>\<c-p>" +endfunction + +"call SuperTabChain(Completefunc, '<c-n>') + +"let g:SuperTabCompletionContexts = ['g:ContextText2'] + + +""""""" General coding stuff """"""" +" Highlight 80th column +set colorcolumn=80 +" Always show status bar +set laststatus=2 +" Let plugins show effects after 500ms, not 4s +set updatetime=500 +" Disable mouse click to go to position +set mouse-=a +" Don't let autocomplete affect usual typing habits +set completeopt=menuone,preview,noinsert +" Let vim-gitgutter do its thing on large files +let g:gitgutter_max_signs=10000 + +" If your terminal's background is white (light theme), uncomment the following +" to make EasyMotion's cues much easier to read. +" hi link EasyMotionTarget String +" hi link EasyMotionShade Comment +" hi link EasyMotionTarget2First String +" hi link EasyMotionTarget2Second Statement + + +""""""" Python stuff """"""" +syntax enable +set number showmatch +set shiftwidth=4 tabstop=4 softtabstop=4 expandtab autoindent +let python_highlight_all = 1 + + +""""""" Keybindings """"""" +" Set up leaders +let mapleader="," +let maplocalleader="\\" + +" Mac OS X option-left / right +noremap â b +noremap æ e +inoremap â <C-o>b +inoremap æ <C-o>e<right> +" Note - this required binding in preferences (Cmd-,) option+backspace to +" escape+z. +" Why this one is complicated - <C-o> at end of line moves cursor by one +" character, which means a trailing character could be left. +inoremap <expr> ú col('.')>1 ? 'T<Left><C-o>db<Delete>' : '<Backspace>T<Left><c-o>db<Delete>' +" Requires binding option+forward delete to escape +inoremap ø <C-o>dw + +" Linux / windows ctrl+backspace ctrl+delete +" Note that ctrl+backspace doesn't work in Linux, so ctrl+\ is also available +imap <C-backspace> ú +imap <C-\> ú +imap <C-delete> ø + +" Arrow keys up/down move visually up and down rather than by whole lines. In +" other words, wrapped lines will take longer to scroll through, but better +" control in long bodies of text. +" NOTE - Disabled since <leader><leader>w|e|b works well with easymotion +"noremap <up> gk +"noremap <down> gj + +" Neomake and other build commands (ctrl-b) +nnoremap <C-b> :w<cr>:Neomake<cr> + +autocmd BufNewFile,BufRead *.tex,*.bib noremap <buffer> <C-b> :w<cr>:new<bar>r !make<cr>:setlocal buftype=nofile<cr>:setlocal bufhidden=hide<cr>:setlocal noswapfile<cr> +autocmd BufNewFile,BufRead *.tex,*.bib imap <buffer> <C-b> <Esc><C-b> + + |