" Basic setup stuff let mapleader=" " set number relativenumber filetype plugin on syntax on set wildmode=longest,list,full set mouse=a set colorcolumn=80 set autoindent noexpandtab tabstop=4 shiftwidth=4 " Quick Save map w :w " Spell check map o :setlocal spell! spelllang=en_us " Open a terminal map t :vsplit term://zsh " Change Line break to 120 map l :set colorcolumn=120 " Change Line break to 80 map L :set colorcolumn=80 " Quick Netrw map x :Ex " Keyboard shortcuts for harpoon map q :lua require("harpoon.ui").toggle_quick_menu() map a :lua require("harpoon.mark").add_file() map n :lua require("harpoon.ui").nav_next() map p :lua require("harpoon.ui").nav_prev() " Telescope Keyboard shortcuts map ts :Telescope find_files " Removes spaces at the end of lines when saving autocmd BufWritePre * %s/\s\+$//e " Center Cursor when entering insert mode autocmd InsertEnter * norm zz " Fixing indenting visual block vmap < >gv " Makes splitting default to the right and to the bottom set splitbelow splitright " Remaps moving keys for splitting map h map j map k map l " Plugins call plug#begin('~/.local/share/nvim/plugged') Plug 'junegunn/goyo.vim' " Nice for reading Documents Plug 'neoclide/coc.nvim', {'branch': 'release'} " Code Completion Plug 'tpope/vim-commentary' " Makes commenting multiple lines easier Plug 'NLKNguyen/papercolor-theme' Plug 'nvim-lua/plenary.nvim' Plug 'nvim-telescope/telescope.nvim', { 'tag': '0.1.0' } Plug 'ThePrimeagen/harpoon' Plug 'neovim/nvim-lspconfig' call plug#end() " Goyo plugin makes text more readable when writing prose: map f :Goyo \| set linebreak " Commentary plugin map c :Commentary \| set linebreak let g:coc_global_extensions = [ \ 'coc-html', \ 'coc-java', \ 'coc-tsserver', \ 'coc-css', \ 'coc-clangd', \ 'coc-go', \ 'coc-pairs', \ 'coc-python', \ 'coc-flutter' \ ] " runs gofmt when closing a go file. autocmd VimLeave *.go !gofmt -w % " This handles gofmt on save " https://www.getman.io/posts/programming-go-in-neovim/ lua require("lsp_config") autocmd BufWritePre *.go lua vim.lsp.buf.formatting() autocmd BufWritePre *.go lua goimports(1000) set t_Co=256 " ChangeBackground changes the background mode based on macOS's `Appearance` " setting. We also refresh the statusline colors to reflect the new mode. function! ChangeBackground() if system("defaults read -g AppleInterfaceStyle") =~ '^Dark' set background=dark " for the dark version of the theme else set background=light " for the light version of the theme endif endfunction " initialize the colorscheme for the first run call ChangeBackground() map b :call ChangeBackground() colorscheme PaperColor