diff --git a/nvim/init.vim b/nvim/init.vim new file mode 100644 index 0000000..0de2fb9 --- /dev/null +++ b/nvim/init.vim @@ -0,0 +1,130 @@ +" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged) +call plug#begin('~/.config/nvim/plugged') + +" Neomake build tool +Plug 'benekastah/neomake' +" Automatically match brackets as you type +Plug 'Raimondi/delimitMate' +" Tab completion +Plug 'ervandew/supertab' +" Haskell +Plug 'neovimhaskell/haskell-vim', { 'for': [ 'haskell', 'cabal' ] } +" Lisp +Plug 'vim-scripts/paredit.vim', { 'for': [ 'scheme', 'lisp', 'commonlisp' ] } +" LaTeX Editing +Plug 'LaTeX-Box-Team/LaTeX-Box' +" EasyMotion - Allows (b|e) to jump to (b)eginning or (end) +" of words. +Plug 'easymotion/vim-easymotion' +" Ctrl-P - Fuzzy file search +Plug 'kien/ctrlp.vim' +" Autocomplete for python +Plug 'davidhalter/jedi-vim' +" Remove extraneous whitespace when edit mode is exited +Plug 'thirtythreeforty/lessspace.vim' +" Status bar mods +Plug 'bling/vim-airline' +Plug 'airblade/vim-gitgutter' +" Manage Project sessions +Plug 'tpope/vim-obsession' +Plug 'dhruvasagar/vim-prosession' +" Explore filesystem +Plug 'scrooloose/nerdtree' +" Tags +Plug 'universal-ctags/ctags' + +" Initialize plugin system +call plug#end() + +syntax on +filetype plugin indent on + +" Don't mess up undo history +let g:jedi#show_call_signatures = "0" + +" 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 + +" Set up leaders +let mapleader="\" + +set encoding=utf-8 +set showcmd " Show (partial) command in status line. +set showmatch " Show matching brackets. +set showmode " Show current mode. +set ruler " Show the line and column numbers of the cursor. +set number " Show the line numbers on the left side. +set formatoptions+=o " Continue comment marker in new lines. +set textwidth=0 " Hard-wrap long lines as you type them. +set expandtab " Insert spaces when TAB is pressed. +set tabstop=4 " Render TABs using this many spaces. +set shiftwidth=2 " Indentation amount for < and > commands. + +set noerrorbells " No beeps. +set modeline " Enable modeline. +set esckeys " Cursor keys in insert mode. +set linespace=0 " Set line-spacing to minimum. +set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J) + +" More natural splits +set splitbelow " Horizontal split below current. +set splitright " Vertical split to right of current. + +if !&scrolloff + set scrolloff=3 " Show next 3 lines while scrolling. +endif +if !&sidescrolloff + set sidescrolloff=5 " Show next 5 columns while side-scrolling. +endif +set nostartofline " Do not jump to first character with page commands. + +set ignorecase " Make searching case insensitive +set smartcase " ... unless the query has capital letters. +set gdefault " Use 'g' flag by default with :s/foo/bar/. +set magic " Use 'magic' patterns (extended regular expressions). + +" Use to clear the highlighting of :set hlsearch. +if maparg('', 'n') ==# '' + nnoremap :nohlsearch +endif + +" Search and Replace +nmap s :%s//g + +nnoremap ; : " Use ; for commands. +nnoremap Q @q " Use Q to execute default register. + +" Open file menu +nnoremap o :CtrlP +" Open buffer menu +nnoremap b :CtrlPBuffer +" Open most recently used files +nnoremap f :CtrlPMRUFiles +" Open NerdTree +nnoremap n :NERDTree + +" Manage splits +set splitbelow +set splitright +nnoremap w w + +let g:airline#extensions#tabline#enabled = 2 +let g:airline#extensions#tabline#fnamemod = ':t' +let g:airline#extensions#tabline#left_sep = ' ' +let g:airline#extensions#tabline#left_alt_sep = '|' +let g:airline#extensions#tabline#right_sep = ' ' +let g:airline#extensions#tabline#right_alt_sep = '|' +let g:airline_left_sep = ' ' +let g:airline_left_alt_sep = '|' +let g:airline_right_sep = ' ' +let g:airline_right_alt_sep = '|'