small pixel drawing of a pufferfish dotfiles

delete fd, moar nvim pluginsz
Jes Olson j3s@c3f.net
Sun, 19 Feb 2023 17:09:24 -0800
commit

8ead1950090b5ffec5f5032205820fcf03a4066a

parent

7d0b920bc9c866f696072137981afae2f2988e67

2 files changed, 15 insertions(+), 18 deletions(-)

jump to
M .config/nvim/init.lua.config/nvim/init.lua

@@ -7,7 +7,11 @@

-- Very powerful search use { 'nvim-telescope/telescope.nvim', tag = '0.1.1', - requires = { {'nvim-lua/plenary.nvim', 'BurntSushi/ripgrep'} } + requires = {{ + 'nvim-lua/plenary.nvim', + 'BurntSushi/ripgrep', + 'nvim-treesitter/nvim-treesitter' + }} } end)

@@ -15,17 +19,20 @@ vim.cmd('colorscheme everforest') -- solarized, but green

vim.cmd('set termguicolors') -- needed for truecolor support vim.cmd('set mmp=2000') -- resolves https://github.com/vim/vim/issues/2049 --- Mappings. --- See `:help vim.diagnostic.*` for documentation on any of the below functions +---- mappings +local builtin = require('telescope.builtin') local opts = { noremap=true, silent=true } +-- telescope +vim.keymap.set('n', '<space>ff', builtin.find_files, {}) +vim.keymap.set('n', '<space>fg', builtin.live_grep, {}) +vim.keymap.set('n', '<space>fb', builtin.buffers, {}) +vim.keymap.set('n', '<space>fh', builtin.help_tags, {}) +-- LSP vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts) vim.keymap.set('n', '<space>m', "Go<esc>:put =strftime('%Y-%m-%d')<cr>o============<cr>", opts) - --- auto-format on save -vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.formatting_sync()]] -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer

@@ -49,18 +56,11 @@ end, bufopts)

vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts) vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts) - vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) - vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts) + vim.keymap.set('n', 'gr', builtin.lsp_references, bufopts) + vim.keymap.set('n', '<space>F', function() vim.lsp.buf.format { async = true } end, bufopts) end ---- golang require('lspconfig')['gopls'].setup{ on_attach = on_attach, } --- organize golang imports on save -vim.api.nvim_create_autocmd('BufWritePre', { - pattern = '*.go', - callback = function() - vim.lsp.buf.code_action({ context = { only = { 'source.organizeImports' } }, apply = true }) - end -})
D bin/fd

@@ -1,3 +0,0 @@

-#!/bin/sh - -find . -iname "*$1*"