if empty(glob('~/.config/nvim/autoload/plug.vim')) silent !curl -fLo ~/.config/nvim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim autocmd! autocmd VimEnter * PlugInstall endif call plug#begin('~/.config/nvim/plugged') "File Search: Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' } Plug 'junegunn/fzf.vim' "File Browser: Plug 'scrooloose/nerdtree' Plug 'jistr/vim-nerdtree-tabs' Plug 'mkitt/tabline.vim' Plug 'ryanoasis/vim-devicons' "Color: Plug 'morhetz/gruvbox' "Golang: Plug 'fatih/vim-go' "Autocomplete: Plug 'ncm2/ncm2' Plug 'ncm2/ncm2-go' Plug 'roxma/nvim-yarp' Plug 'roxma/vim-hug-neovim-rpc' Plug 'stamblerre/gocode', { 'rtp': 'nvim', 'do': '~/.config/nvim/plugged/gocode/nvim/symlink.sh' } "Snippets: Plug 'ncm2/ncm2-ultisnips' Plug 'SirVer/ultisnips' "Git: Plug 'tpope/vim-fugitive' call plug#end() "COPY/PASTE: "----------- "Increases the memory limit from 50 lines to 1000 lines :set viminfo='100,<1000,s10,h "NUMBERING: "---------- :set number "INDENTATION: "------------ "Highlights code for multiple indents without reselecting vnoremap < >gv "COLOR: "------ colorscheme gruvbox "AUTO IMPORT: "------------ let g:go_fmt_command = "goimports" "AUTOCOMPLETE: "------------- augroup ncm2 au! autocmd BufEnter * call ncm2#enable_for_buffer() set completeopt=noinsert,menuone,noselect au User Ncm2PopupOpen set completeopt=noinsert,menuone,noselect au User Ncm2PopupClose set completeopt=menuone augroup END "Press Enter to select item in autocomplete popup inoremap (pumvisible() ? ncm2_ultisnips#expand_or("\", 'n') : "\") "Cycle through completion entries with tab/shift+tab inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" "Allow getting out of pop with Down/Up arrow keys inoremap pumvisible() ? "\" : "\" inoremap pumvisible() ? "\" : "\" "SNIPPETS: "--------- "Change default expand since TAB is used to cycle options let g:UltiSnipsExpandTrigger="" let g:UltiSnipsJumpForwardTrigger="" let g:UltiSnipsJumpBackwardTrigger="" "FILE SEARCH: "------------ "allows FZF to open by pressing CTRL-F map :FZF "allow FZF to search hidden 'dot' files let $FZF_DEFAULT_COMMAND = "find -L" "FILE BROWSER: "------------- "allows NERDTree to open/close by typing 'n' then 't' map nt :NERDTreeTabsToggle "Start NERDtree when dir is selected (e.g. "vim .") and start NERDTreeTabs let g:nerdtree_tabs_open_on_console_startup=2 "Add a close button in the upper right for tabs let g:tablineclosebutton=1 "Automatically find and select currently opened file in NERDTree let g:nerdtree_tabs_autofind=1 "Add folder icon to directories let g:WebDevIconsUnicodeDecorateFolderNodes = 1 let g:DevIconsEnableFoldersOpenClose = 1 "Hide expand/collapse arrows let g:NERDTreeDirArrowExpandable = "\u00a0" let g:NERDTreeDirArrowCollapsible = "\u00a0" let g:WebDevIconsNerdTreeBeforeGlyphPadding = "" highlight! link NERDTreeFlags NERDTreeDir "SHORTCUTS: "---------- "Open file at same line last closed if has("autocmd") au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") \| exe "normal! g'\"" | endif endif "SOURCING: "--------- "Automatically reloads neovim configuration file on write (w) autocmd! bufwritepost init.vim source % "MOUSE: "------ "Allow using mouse helpful for switching/resizing windows set mouse+=a if &term =~ '^screen' " tmux knows the extended mouse mode set ttymouse=xterm2 endif "TEXT SEARCH: "------------ "Makes Search Case Insensitive set ignorecase "SWAP: "----- set dir=~/.local/share/nvim/swap/ "GIT (FUGITIVE): "--------------- map fgb :Gblame map fgs :Gstatus map fgl :Glog map fgd :Gdiff map fgc :Gcommit map fga :Git add %:p "SYNTAX HIGHLIGHTING: "-------------------- syntax on "HIGHLIGHTING: "------------- " redraws the screen and removes any search highlighting. nnoremap :nohl " Highlight the current line the cursor is on set cursorline