feat: updated tools to fit my needs
This commit is contained in:
parent
ff1b9952e9
commit
a68fec9cbc
|
|
@ -18,15 +18,12 @@ return {
|
|||
return 'make install_jsregexp'
|
||||
end)(),
|
||||
dependencies = {
|
||||
-- `friendly-snippets` contains a variety of premade snippets.
|
||||
-- See the README about individual language/framework/plugin snippets:
|
||||
-- https://github.com/rafamadriz/friendly-snippets
|
||||
-- {
|
||||
-- 'rafamadriz/friendly-snippets',
|
||||
-- config = function()
|
||||
-- require('luasnip.loaders.from_vscode').lazy_load()
|
||||
-- end,
|
||||
-- },
|
||||
{
|
||||
'rafamadriz/friendly-snippets',
|
||||
config = function()
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
end,
|
||||
},
|
||||
},
|
||||
opts = {},
|
||||
},
|
||||
|
|
@ -64,6 +61,7 @@ return {
|
|||
['<C-j>'] = { 'select_next', 'fallback' },
|
||||
['<C-p>'] = { 'select_prev', 'fallback' },
|
||||
['<C-n>'] = { 'select_next', 'fallback' },
|
||||
['<tab>'] = false,
|
||||
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
preset = 'super-tab',
|
||||
|
|
|
|||
|
|
@ -64,23 +64,28 @@ return {
|
|||
|
||||
-- Execute a code action, usually your cursor needs to be on top of an error
|
||||
-- or a suggestion from your LSP for this to activate.
|
||||
map('gra', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||
map('gca', vim.lsp.buf.code_action, '[G]oto Code [A]ction', { 'n', 'x' })
|
||||
|
||||
-- Find references for the word under your cursor.
|
||||
map('grr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
|
||||
-- Jump to the implementation of the word under your cursor.
|
||||
-- Useful when your language has ways of declaring types without an actual implementation.
|
||||
map('gri', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
map('gi', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
||||
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
map('grd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
||||
|
||||
-- WARN: This is not Goto Definition, this is Goto Declaration.
|
||||
-- For example, in C this would take you to the header.
|
||||
map('grD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
||||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
map('gt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
|
|
@ -90,11 +95,6 @@ return {
|
|||
-- Similar to document symbols, except searches over your entire project.
|
||||
map('gW', require('telescope.builtin').lsp_dynamic_workspace_symbols, 'Open Workspace Symbols')
|
||||
|
||||
-- Jump to the type of the word under your cursor.
|
||||
-- Useful when you're not sure what type a variable is and you want to see
|
||||
-- the definition of its *type*, not where it was *defined*.
|
||||
map('grt', require('telescope.builtin').lsp_type_definitions, '[G]oto [T]ype Definition')
|
||||
|
||||
-- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
|
||||
---@param client vim.lsp.Client
|
||||
---@param method vim.lsp.protocol.Method
|
||||
|
|
@ -183,6 +183,7 @@ return {
|
|||
-- When you add blink.cmp, luasnip, etc. Neovim now has *more* capabilities.
|
||||
-- So, we create new capabilities with blink.cmp, and then broadcast that to the servers.
|
||||
local capabilities = require('blink.cmp').get_lsp_capabilities()
|
||||
local util = require 'lspconfig/util'
|
||||
|
||||
-- Enable the following language servers
|
||||
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
|
||||
|
|
@ -195,7 +196,21 @@ return {
|
|||
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
|
||||
local servers = {
|
||||
-- clangd = {},
|
||||
gopls = {},
|
||||
gopls = {
|
||||
capabilities = capabilities,
|
||||
cmd = { 'gopls' },
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
root_dir = util.root_pattern('go.work', 'go.mod', '.git'),
|
||||
settings = {
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
-- pyright = {},
|
||||
rust_analyzer = {},
|
||||
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@ return { -- Fuzzy Finder (files, lsp, etc)
|
|||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
['<C-space>'] = actions.add_selection,
|
||||
['<C-l>'] = actions.add_selection,
|
||||
['<C-h>'] = actions.add_selection,
|
||||
['<C-l>'] = actions.select_default,
|
||||
['<C-w>'] = actions.add_selected_to_qflist + actions.open_qflist,
|
||||
['<C-c>'] = actions.close,
|
||||
},
|
||||
|
|
@ -98,7 +99,7 @@ return { -- Fuzzy Finder (files, lsp, etc)
|
|||
vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[F]ind [D]iagnostics' })
|
||||
vim.keymap.set('n', '<leader>f.', builtin.resume, { desc = '[F]ind [R]esume' })
|
||||
vim.keymap.set('n', '<leader>fr', builtin.oldfiles, { desc = '[F]ind [R]ecent Files' })
|
||||
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||
vim.keymap.set('n', '<leader>f<leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
vim.keymap.set('n', '<leader>/', function()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,13 @@ return { -- Highlight, edit, and navigate code
|
|||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
dependencies = {
|
||||
{ 'nvim-treesitter/nvim-treesitter-textobjects' },
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
opts = { enable = true, mode = 'topline', line_numbers = true },
|
||||
},
|
||||
},
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
opts = {
|
||||
ensure_installed = {
|
||||
|
|
@ -30,8 +37,10 @@ return { -- Highlight, edit, and navigate code
|
|||
additional_vim_regex_highlighting = { 'ruby' },
|
||||
},
|
||||
indent = { enable = true, disable = { 'ruby' } },
|
||||
textobjects = { select = { enable = true, lookahead = true } },
|
||||
},
|
||||
-- There are additional nvim-treesitter modules that you can use to interact
|
||||
-- There are additional nvim-treesitter modules that you can use textobjectsto in
|
||||
-- eract
|
||||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||
--
|
||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||
|
|
|
|||
Loading…
Reference in New Issue