diff options
| author | Jacob McDonnell <jacob@simplelittledream.com> | 2022-11-24 11:31:53 -0500 |
|---|---|---|
| committer | Jacob McDonnell <jacob@simplelittledream.com> | 2022-11-24 11:31:53 -0500 |
| commit | 7ed38f42d4b41a6621a052b3f3ab6bdf26a1f09d (patch) | |
| tree | 181b929b8c0407168b2c1b6e8599558919a05328 /.config/nvim/init.vim | |
| parent | ced8c4826a71ccd929266f3e3a8de3ca6c6f953d (diff) | |
Gofmt on save in nvim
Diffstat (limited to '.config/nvim/init.vim')
| -rw-r--r-- | .config/nvim/init.vim | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 6ed4ff1..3c6dad3 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -62,10 +62,11 @@ 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 <leader>f :Goyo \| set bg=dark \| set linebreak<CR> +map <leader>f :Goyo \| set linebreak<CR> " Commentary plugin map <leader>c :Commentary \| set linebreak<CR> @@ -78,12 +79,19 @@ let g:coc_global_extensions = [ \ 'coc-clangd', \ 'coc-go', \ 'coc-pairs', - \ 'coc-python' + \ '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` |
