" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged) call plug#begin('~/.config/nvim/plugged') " Automatically match brackets as you type Plug 'Raimondi/delimitMate' " Tab completion Plug 'ervandew/supertab' " EasyMotion - Allows (b|e) to jump to (b)eginning or (end) " of words. Plug 'easymotion/vim-easymotion' " Fuzzy file search "Plug '~/.fzf' Plug 'junegunn/fzf.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' " Commenter Plug 'scrooloose/nerdcommenter' " Theme Plug 'sickill/vim-monokai' " Autoload and read from dish if file changes Plug 'tmux-plugins/vim-tmux-focus-events' " For LaTeX support Plug 'lervag/vimtex' " For git support Plug 'tpope/vim-fugitive' Plug 'junegunn/gv.vim' Plug 'rhysd/git-messenger.vim' Plug 'sodapopcan/vim-twiggy' Plug 'christoomey/vim-conflicted' " For tmux yank Plug 'vim-utils/vim-husk' " gtags Plug 'jsfaint/gen_tags.vim' " Lisp Plug 'eraserhd/parinfer-rust', { 'do': 'cargo build --release' } Plug 'l04m33/vlime', { 'rtp': '~/.config/nvim/plugged' } " Haskell Plug 'neovimhaskell/haskell-vim', { 'for': [ 'haskell', 'cabal' ] } Plug 'parsonsmatt/intero-neovim' Plug 'neomake/neomake' Plug 'autozimu/LanguageClient-neovim' , { \ 'branch' : 'next', \ 'do' : './install.sh' \ } " For autocompletion Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' } " Autocomplete for Python Plug 'zchee/deoplete-jedi' " Autocomplete for Rust Plug 'sebastianmarkow/deoplete-rust' Plug 'rust-lang/rust.vim' " For Scala Plug 'derekwyatt/vim-scala' " Miscellaneous Plug 'tpope/vim-surround' Plug 'editorconfig/editorconfig-vim' Plug 'tpope/vim-eunuch' Plug 'jeetsukumaran/vim-buffergator' Plug 'Shougo/echodoc.vim' " Initialize plugin system call plug#end() syntax on filetype plugin indent on " 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 " Set up leaders let mapleader="\" set encoding=utf-8 set exrc " Allow loading local .nvimrc files set secure " Disallow use of autocmd, shell and write in local rc 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 softtabstop=4 " Finetunes the amount of white space to be added. set tabstop=4 " Render TABs using this many spaces. set shiftwidth=4 " Indentation amount for < and > commands. set smarttab " Indent with tabs, align with spaces. set expandtab " When on, uses space instead of tabs. set cmdheight=2 " For echodoc set noerrorbells " No beeps. set modeline " Enable modeline. 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). set autoread " Autoload file if it changes on disk set rtp+=/usr/bin/fzf set completeopt-=preview " 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 NerdTree nnoremap n :NERDTree " Open fuzzy file search nnoremap f :Files nnoremap gf :GFiles " Use ripgrep to search for content in files nnoremap / :Rg " For git messenger nnoremap gm :GitMessenger " Manage splits set splitbelow set splitright nnoremap w w " Theme syntax enable colorscheme monokai " Key Bindings to help with terminal mode :tnoremap " Key bindings to move between window splits nnoremap h nnoremap j nnoremap k nnoremap l " Disable Arrow Keys inoremap inoremap inoremap inoremap noremap noremap noremap noremap " For Haskell let g:echodoc#enable_at_startup = 1 let g:echodoc#type = 'signature' let g:LanguageClient_autoStart = 0 let g:LanguageClient_loggingFile = expand('$HOME/LC.log') let g:LanguageClient_rootMarkers = ['stack.yaml', 'build.sbt'] let g:LanguageClient_serverCommands = { \ 'haskell': ['$HOME/.local/bin/hie-wrapper'], \ 'scala': ['metals-vim'], \ } nnoremap ld :call LanguageClient#textDocument_definition() nnoremap lr :call LanguageClient#textDocument_rename() nnoremap lf :call LanguageClient#textDocument_formatting() nnoremap lt :call LanguageClient#textDocument_typeDefinition() nnoremap lx :call LanguageClient#textDocument_references() nnoremap la :call LanguageClient_workspace_applyEdit() nnoremap lc :call LanguageClient#textDocument_completion() nnoremap lh :call LanguageClient#textDocument_hover() nnoremap ls :call LanguageClient_textDocument_documentSymbol() nnoremap lm :call LanguageClient_contextMenu() nnoremap la :call LanguageClient#textDocument_codeAction() let g:haskell_enable_quantification = 1 " to enable highlighting of `forall` let g:haskell_enable_recursivedo = 1 " to enable highlighting of `mdo` and `rec` let g:haskell_enable_arrowsyntax = 1 " to enable highlighting of `proc` let g:haskell_enable_pattern_synonyms = 1 " to enable highlighting of `pattern` let g:haskell_enable_typeroles = 1 " to enable highlighting of type roles let g:haskell_enable_static_pointers = 1 " to enable highlighting of `static` let g:haskell_backpack = 1 " to enable highlighting of backpack keywords let g:haskell_classic_highlighting = 1 let g:haskell_indent_if = 3 let g:haskell_indent_case = 2 let g:haskell_indent_let = 4 let g:haskell_indent_where = 6 let g:haskell_indent_before_where = 2 let g:haskell_indent_after_bare_where = 2 let g:haskell_indent_do = 3 let g:haskell_indent_in = 1 let g:haskell_indent_guard = 2 let g:haskell_indent_case_alternative = 1 let g:cabal_indent_section = 2 augroup interoMaps au! " Maps for intero. Restrict to Haskell buffers so the bindings don't collide. " Background process and window management au FileType haskell nnoremap is :InteroStart au FileType haskell nnoremap ir :InteroRestart au FileType haskell nnoremap ik :InteroKill " Open intero/GHCi split horizontally au FileType haskell nnoremap io :InteroOpen " Open intero/GHCi split vertically au FileType haskell nnoremap iov :InteroOpenH au FileType haskell nnoremap ih :InteroHide " Reloading (pick one) " Automatically reload on save " au BufWritePost *.hs InteroReload " Manually save and reload au FileType haskell nnoremap wr :w \| :InteroReload " Load individual modules au FileType haskell nnoremap il :InteroLoadCurrentModule au FileType haskell nnoremap if :InteroLoadCurrentFile " Type-related information " Heads up! These next two differ from the rest. au FileType haskell map it InteroGenericType au FileType haskell map T InteroType au FileType haskell nnoremap iit :InteroTypeInsert " Navigation au FileType haskell nnoremap id :InteroGoToDef " Managing targets " Prompts you to enter targets (no silent): au FileType haskell nnoremap ist :InteroSetTargets augroup END " Intero starts automatically. Set this if you'd like to prevent that. let g:intero_start_immediately = 0 " Enable type information on hover (when holding cursor at point for ~1 second). let g:intero_type_on_hover = 0 " Change the intero window size; default is 10. let g:intero_window_size = 15 " Sets the intero window to split vertically; default is horizontal let g:intero_vertical_split = 1 " OPTIONAL: Make the update time shorter, so the type info will trigger faster. set updatetime=1000 " Use deoplete let g:deoplete#enable_at_startup = 1 let g:deoplete#sources#rust#racer_binary='$HOME/.cargo/bin/racer' let g:deoplete#sources#rust#rust_source_path='$HOME/GitSources/rust/src' " Use airline 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 = '|' " Prevent loading of ctags let g:loaded_gentags#ctags = 1 " Let vim-gitgutter do its thing on large files let g:gitgutter_max_signs=10000 " For vim-scala au BufRead,BufNewFile *.sbt set filetype=scala