update configs
This commit is contained in:
parent
cb9096c05a
commit
625a356917
|
@ -0,0 +1,7 @@
|
|||
-- If you want insert `(` after select function or method item
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
|
@ -0,0 +1,15 @@
|
|||
-- require 'lspconfig'.grammarly.setup {
|
||||
-- filetypes = { "markdown", "tex", "go" },
|
||||
-- }
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = ''
|
||||
})
|
||||
end
|
||||
|
||||
sign({ name = 'DiagnosticSignError', text = '✘' })
|
||||
sign({ name = 'DiagnosticSignWarn', text = '▲' })
|
||||
sign({ name = 'DiagnosticSignHint', text = '⚑' })
|
||||
sign({ name = 'DiagnosticSignInfo', text = '»' })
|
|
@ -0,0 +1,65 @@
|
|||
local function map(mode, lhs, rhs)
|
||||
vim.keymap.set(mode, lhs, rhs, { silent = true })
|
||||
end
|
||||
|
||||
-- (conflict with <leader>pw) keep copied stuffs in the buffer when pasting it
|
||||
-- map("n", "<leader>p", "\"_dP")
|
||||
|
||||
-- Save
|
||||
map("n", "<leader>w", "<CMD>update<CR>")
|
||||
|
||||
map("n", "<C-q>", "<CMD>q<CR>")
|
||||
-- Quit
|
||||
|
||||
-- Exit insert mode
|
||||
map("i", "jj", "<ESC>")
|
||||
|
||||
-- Window split
|
||||
map("n", "<leader>sv", "<CMD>vsplit<CR>")
|
||||
map("n", "<leader>sh", "<CMD>split<CR>")
|
||||
|
||||
-- Window resize
|
||||
map("n", "<c-Left>", "<c-w><")
|
||||
map("n", "<c-Right>", "<c-w>>")
|
||||
map("n", "<c-Up>", "<c-w>+")
|
||||
map("n", "<c-Down>", "<c-w>-")
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv-gv")
|
||||
|
||||
map("n", "J", "mzJ`z")
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
map("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
|
||||
-- Buffer
|
||||
map("n", "<TAB>", "<CMD>bnext<CR>")
|
||||
map("n", "<s-TAB>", "<CMD>bprevious<CR>")
|
||||
|
||||
map("n", "Q", "<Nop>")
|
||||
map("n", "<c-f>", "<CMD>silent !tmux new tmux-sessionizer<CR>")
|
||||
|
||||
-- LSP format
|
||||
map("n", "<leader>f", function()
|
||||
vim.lsp.buf.format()
|
||||
end)
|
||||
|
||||
-- Search and replace
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
|
||||
-- Reset highlight
|
||||
map("n", "<CR>", "<CMD>noh<CR><CR>")
|
||||
|
||||
-- Hover documentation
|
||||
map("n", "K", "<CMD>lua vim.lsp.buf.hover()<CR>")
|
||||
vim.keymap.set("n", '<C-k>', vim.lsp.buf.signature_help, { desc = '[S]ignature [D]ocumentation' })
|
||||
|
||||
-- spell check
|
||||
vim.keymap.set("n", "<F3>", "<CMD>set spell!<CR>", { silent = true, desc = 'Toggle spell check' })
|
||||
vim.keymap.set("i", "<F3>", "<C-O>:set spell!<CR>", { silent = true, desc = 'Toggle spell check' })
|
||||
|
||||
-- Hide windows
|
||||
vim.keymap.set("n", "<leader>hw", "<CMD>only<CR>", { silent = true, desc = 'Hide windows' })
|
|
@ -0,0 +1,60 @@
|
|||
local global = vim.g
|
||||
local o = vim.o
|
||||
local opt = vim.opt
|
||||
|
||||
-- Copilot
|
||||
global.copilot_assume_mapped = true
|
||||
|
||||
-- Editor options
|
||||
o.relativenumber = true
|
||||
o.syntax = 'on'
|
||||
o.autoindent = true
|
||||
o.cursorline = true
|
||||
o.expandtab = true
|
||||
o.shiftwidth = 2
|
||||
o.tabstop = 2
|
||||
o.encoding = 'utf-8'
|
||||
o.ruler = true
|
||||
o.title = true
|
||||
o.hidden = true
|
||||
o.wildmenu = true
|
||||
o.showcmd = true
|
||||
o.showmatch = true
|
||||
o.inccommand = 'split'
|
||||
o.splitbelow = true -- open new vertical split bottom
|
||||
o.splitright = true -- open new horizontal split right
|
||||
o.smartindent = true
|
||||
o.wrap = false
|
||||
|
||||
-- Highlight search
|
||||
o.hlsearch = true
|
||||
o.incsearch = true
|
||||
|
||||
-- No vim backup files
|
||||
o.backup = false
|
||||
o.swapfile = false
|
||||
|
||||
-- Scrolling settings
|
||||
o.scrolloff = 8
|
||||
o.colorcolumn = '120'
|
||||
|
||||
o.timeoutlen = 500
|
||||
|
||||
-- Spell check
|
||||
opt.spelllang = 'en_us'
|
||||
-- opt.spell = true
|
||||
|
||||
-- Markdown
|
||||
global.mkdp_browser = '/usr/bin/firefox'
|
||||
|
||||
-- Fold
|
||||
--o.foldmethod = 'syntax'
|
||||
-- o.foldmethod = 'expr'
|
||||
-- o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
-- o.foldlevel = 1
|
||||
-- o.foldnestmax = 1
|
||||
-- o.nofoldenable = false
|
||||
opt.foldmethod = 'indent'
|
||||
opt.foldenable = false
|
||||
opt.foldlevel = 99
|
||||
global.markdown_folding = 1
|
|
@ -0,0 +1,16 @@
|
|||
-- Go to referenece
|
||||
-- vim.keymap.del("n", "gr")
|
||||
-- vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, { desc = '[G]oto [R]reference', noremap = false })
|
||||
local actions = require("telescope.actions")
|
||||
local trouble = require("trouble.providers.telescope")
|
||||
|
||||
local telescope = require("telescope")
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
n = { ["<c-t>"] = trouble.open_with_trouble },
|
||||
},
|
||||
},
|
||||
}
|
88
init.lua
88
init.lua
|
@ -448,7 +448,8 @@ vim.keymap.set('n', '<leader>sr', require('telescope.builtin').resume, { desc =
|
|||
vim.defer_fn(function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
-- Add languages to be installed here that you want installed for treesitter
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', 'bash', 'http', 'json' },
|
||||
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim',
|
||||
'bash', 'http', 'json' },
|
||||
|
||||
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
|
||||
auto_install = false,
|
||||
|
@ -561,6 +562,24 @@ local on_attach = function(_, bufnr)
|
|||
vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_)
|
||||
vim.lsp.buf.format()
|
||||
end, { desc = 'Format current buffer with LSP' })
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
|
||||
vim.lsp.diagnostic.on_publish_diagnostics, {
|
||||
-- Enable underline, use default values
|
||||
underline = false,
|
||||
|
||||
-- disable virtual text
|
||||
virtual_text = true,
|
||||
|
||||
-- show signs
|
||||
signs = true,
|
||||
|
||||
-- delay update diagnostics
|
||||
update_in_insert = false,
|
||||
|
||||
float = true,
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
-- document existing key chains
|
||||
|
@ -597,16 +616,69 @@ require('mason-lspconfig').setup()
|
|||
local servers = {
|
||||
-- clangd = {},
|
||||
gopls = {
|
||||
filetypes = { 'go', 'gomod', 'gowork', 'gotmpl' },
|
||||
cmd = { 'gopls' },
|
||||
gopls = {
|
||||
completeUnimported = true,
|
||||
usePlaceholders = true,
|
||||
analyses = {
|
||||
unreachable = true,
|
||||
nilness = true,
|
||||
unusedparams = true,
|
||||
showdown = true,
|
||||
useany = true,
|
||||
unusedwrite = true,
|
||||
undeclaredname = true,
|
||||
fillreturns = true,
|
||||
nonewvars = true,
|
||||
fieldalignment = true,
|
||||
shadow = true,
|
||||
unusedvariable = true,
|
||||
ST1003 = true,
|
||||
ST1008 = true,
|
||||
},
|
||||
codelenses = {
|
||||
generate = true, -- show the `go generate` lens.
|
||||
gc_details = true, -- Show a code lens toggling the display of gc's choices.
|
||||
test = true,
|
||||
tidy = true,
|
||||
vendor = true,
|
||||
regenerate_cgo = true,
|
||||
upgrade_dependency = true,
|
||||
run_govulncheck = true,
|
||||
},
|
||||
usePlaceholders = true,
|
||||
completeUnimported = true,
|
||||
staticcheck = true,
|
||||
matcher = 'Fuzzy',
|
||||
diagnosticsDelay = '500ms',
|
||||
symbolMatcher = 'fuzzy',
|
||||
buildFlags = { '-tags', 'integration' },
|
||||
vulncheck = "Imports",
|
||||
hints = {
|
||||
constantValues = true,
|
||||
rangeVariableTypes = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
ltex = {
|
||||
dictionary = {
|
||||
enabled = { 'tex', 'latex', 'bib', 'markdown', 'go' },
|
||||
language = 'en',
|
||||
diagnosticSeverity = 'information',
|
||||
setenceCacheSize = 2000,
|
||||
additionalRules = {
|
||||
enablePickyRules = true,
|
||||
motherTonque = true,
|
||||
},
|
||||
trace = {
|
||||
server = 'verbose',
|
||||
},
|
||||
dictionary = {},
|
||||
disabledRules = {},
|
||||
hiddenFalsePositives = {},
|
||||
}
|
||||
},
|
||||
grammarly = {
|
||||
filetypes = { 'markdown' },
|
||||
},
|
||||
-- pyright = {},
|
||||
-- rust_analyzer = {},
|
||||
-- tsserver = {},
|
||||
|
@ -703,7 +775,7 @@ cmp.setup {
|
|||
-- vim: ts=2 sts=2 sw=2 et
|
||||
--
|
||||
-- custom settings
|
||||
require("custom.configs.settings")
|
||||
|
||||
-- custom mappings
|
||||
require("custom.configs.maps")
|
||||
-- require("custom.configs.settings")
|
||||
--
|
||||
-- -- custom mappings
|
||||
-- require("custom.configs.maps")
|
||||
|
|
|
@ -1,67 +1,58 @@
|
|||
local function map(mode, lhs, rhs)
|
||||
vim.keymap.set(mode, lhs, rhs, { silent = true })
|
||||
end
|
||||
|
||||
-- (conflict with <leader>pw) keep copied stuffs in the buffer when pasting it
|
||||
-- map("n", "<leader>p", "\"_dP")
|
||||
|
||||
-- Save
|
||||
map("n", "<leader>w", "<CMD>update<CR>")
|
||||
|
||||
-- Quit
|
||||
map("n", "<leader>q", "<CMD>q<CR>")
|
||||
|
||||
-- Exit insert mode
|
||||
map("i", "jj", "<ESC>")
|
||||
|
||||
-- Window split
|
||||
map("n", "<leader>sv", "<CMD>vsplit<CR>")
|
||||
map("n", "<leader>sh", "<CMD>split<CR>")
|
||||
|
||||
-- Window resize
|
||||
map("n", "<c-Left>", "<c-w><")
|
||||
map("n", "<c-Right>", "<c-w>>")
|
||||
map("n", "<c-Up>", "<c-w>+")
|
||||
map("n", "<c-Down>", "<c-w>-")
|
||||
|
||||
-- Move selected line / block of text in visual mode
|
||||
map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
map("v", "K", ":m '<-2<CR>gv-gv")
|
||||
|
||||
map("n", "J", "mzJ`z")
|
||||
map("n", "<C-d>", "<C-d>zz")
|
||||
map("n", "<C-u>", "<C-u>zz")
|
||||
map("n", "n", "nzzzv")
|
||||
map("n", "N", "Nzzzv")
|
||||
|
||||
-- Buffer
|
||||
map("n", "<TAB>", "<CMD>bnext<CR>")
|
||||
map("n", "<s-TAB>", "<CMD>bprevious<CR>")
|
||||
|
||||
map("n", "Q", "<Nop>")
|
||||
map("n", "<c-f>", "<CMD>silent !tmux new tmux-sessionizer<CR>")
|
||||
|
||||
-- LSP format
|
||||
map("n", "<leader>f", function()
|
||||
vim.lsp.buf.format()
|
||||
end)
|
||||
|
||||
-- Search and replace
|
||||
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
|
||||
|
||||
-- Reset highlight
|
||||
map("n", "<CR>", "<CMD>noh<CR><CR>")
|
||||
|
||||
-- Hover documentation
|
||||
map("n", "K", "<CMD>lua vim.lsp.buf.hover()<CR>")
|
||||
vim.keymap.set("n", '<C-k>', vim.lsp.buf.signature_help, { desc = '[S]ignature [D]ocumentation' })
|
||||
|
||||
-- Go to referenece
|
||||
vim.keymap.set("n", "gr", require('telescope.builtin').lsp_references, { desc = '[G]oto [R]reference' })
|
||||
|
||||
vim.keymap.set("n", "gpd", "<CMD>lua require('goto-preview').goto_preview_definition()<CR>", { noremap = true })
|
||||
vim.keymap.set("n", "gpt", "<CMD>lua require('goto-preview').goto_preview_type_definition()<CR>", { noremap = true })
|
||||
vim.keymap.set("n", "gpi", "<CMD>lua require('goto-preview').goto_preview_implementation()<CR>", { noremap = true })
|
||||
vim.keymap.set("n", "gP", "<CMD>lua require('goto-preview').close_all_win()<CR>", { noremap = true })
|
||||
vim.keymap.set("n", "gpr", "<CMD>lua require('goto-preview').goto_preview_references()<CR>", { noremap = true })
|
||||
-- local function map(mode, lhs, rhs)
|
||||
-- vim.keymap.set(mode, lhs, rhs, { silent = true })
|
||||
-- end
|
||||
--
|
||||
-- -- (conflict with <leader>pw) keep copied stuffs in the buffer when pasting it
|
||||
-- -- map("n", "<leader>p", "\"_dP")
|
||||
--
|
||||
-- -- Save
|
||||
-- map("n", "<leader>w", "<CMD>update<CR>")
|
||||
--
|
||||
-- -- Quit
|
||||
-- map("n", "<leader>q", "<CMD>q<CR>")
|
||||
--
|
||||
-- -- Exit insert mode
|
||||
-- map("i", "jj", "<ESC>")
|
||||
--
|
||||
-- -- Window split
|
||||
-- map("n", "<leader>sv", "<CMD>vsplit<CR>")
|
||||
-- map("n", "<leader>sh", "<CMD>split<CR>")
|
||||
--
|
||||
-- -- Window resize
|
||||
-- map("n", "<c-Left>", "<c-w><")
|
||||
-- map("n", "<c-Right>", "<c-w>>")
|
||||
-- map("n", "<c-Up>", "<c-w>+")
|
||||
-- map("n", "<c-Down>", "<c-w>-")
|
||||
--
|
||||
-- -- Move selected line / block of text in visual mode
|
||||
-- map("v", "J", ":m '>+1<CR>gv=gv")
|
||||
-- map("v", "K", ":m '<-2<CR>gv-gv")
|
||||
--
|
||||
-- map("n", "J", "mzJ`z")
|
||||
-- map("n", "<C-d>", "<C-d>zz")
|
||||
-- map("n", "<C-u>", "<C-u>zz")
|
||||
-- map("n", "n", "nzzzv")
|
||||
-- map("n", "N", "Nzzzv")
|
||||
--
|
||||
-- -- Buffer
|
||||
-- map("n", "<TAB>", "<CMD>bnext<CR>")
|
||||
-- map("n", "<s-TAB>", "<CMD>bprevious<CR>")
|
||||
--
|
||||
-- map("n", "Q", "<Nop>")
|
||||
-- map("n", "<c-f>", "<CMD>silent !tmux new tmux-sessionizer<CR>")
|
||||
--
|
||||
-- -- LSP format
|
||||
-- map("n", "<leader>f", function()
|
||||
-- vim.lsp.buf.format()
|
||||
-- end)
|
||||
--
|
||||
-- -- Search and replace
|
||||
-- map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
|
||||
--
|
||||
--
|
||||
-- -- Reset highlight
|
||||
-- map("n", "<CR>", "<CMD>noh<CR><CR>")
|
||||
--
|
||||
-- -- Hover documentation
|
||||
-- map("n", "K", "<CMD>lua vim.lsp.buf.hover()<CR>")
|
||||
-- vim.keymap.set("n", '<C-k>', vim.lsp.buf.signature_help, { desc = '[S]ignature [D]ocumentation' })
|
||||
|
|
|
@ -1,61 +1,61 @@
|
|||
local global = vim.g
|
||||
local o = vim.o
|
||||
local opt = vim.opt
|
||||
|
||||
-- Copilot
|
||||
global.copilot_assume_mapped = true
|
||||
|
||||
-- Editor options
|
||||
o.relativenumber = true
|
||||
o.syntax = 'on'
|
||||
o.autoindent = true
|
||||
o.cursorline = true
|
||||
o.expandtab = true
|
||||
o.shiftwidth = 2
|
||||
o.tabstop = 2
|
||||
o.encoding = 'utf-8'
|
||||
o.ruler = true
|
||||
o.title = true
|
||||
o.hidden = true
|
||||
o.wildmenu = true
|
||||
o.showcmd = true
|
||||
o.showmatch = true
|
||||
o.inccommand = 'split'
|
||||
o.splitbelow = true -- open new vertical split bottom
|
||||
o.splitright = true -- open new horizontal split right
|
||||
o.smartindent = true
|
||||
o.wrap = false
|
||||
|
||||
-- Highlight search
|
||||
o.hlsearch = true
|
||||
o.incsearch = true
|
||||
|
||||
-- No vim backup files
|
||||
o.backup = false
|
||||
o.swapfile = false
|
||||
|
||||
-- Scrolling settings
|
||||
o.scrolloff = 8
|
||||
o.colorcolumn = '120'
|
||||
|
||||
o.timeoutlen = 500
|
||||
|
||||
-- Spell check
|
||||
opt.spelllang = 'en_us'
|
||||
-- opt.spell = true
|
||||
|
||||
-- Markdown
|
||||
global.mkdp_browser = '/usr/bin/firefox'
|
||||
|
||||
-- Fold
|
||||
--o.foldmethod = 'syntax'
|
||||
-- o.foldmethod = 'expr'
|
||||
-- o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
-- o.foldlevel = 1
|
||||
-- o.foldnestmax = 1
|
||||
-- o.nofoldenable = false
|
||||
opt.foldmethod = 'indent'
|
||||
opt.foldenable = false
|
||||
opt.foldlevel = 99
|
||||
global.markdown_folding = 1
|
||||
|
||||
-- local global = vim.g
|
||||
-- local o = vim.o
|
||||
-- local opt = vim.opt
|
||||
--
|
||||
-- -- Copilot
|
||||
-- global.copilot_assume_mapped = true
|
||||
--
|
||||
-- -- Editor options
|
||||
-- o.relativenumber = true
|
||||
-- o.syntax = 'on'
|
||||
-- o.autoindent = true
|
||||
-- o.cursorline = true
|
||||
-- o.expandtab = true
|
||||
-- o.shiftwidth = 2
|
||||
-- o.tabstop = 2
|
||||
-- o.encoding = 'utf-8'
|
||||
-- o.ruler = true
|
||||
-- o.title = true
|
||||
-- o.hidden = true
|
||||
-- o.wildmenu = true
|
||||
-- o.showcmd = true
|
||||
-- o.showmatch = true
|
||||
-- o.inccommand = 'split'
|
||||
-- o.splitbelow = true -- open new vertical split bottom
|
||||
-- o.splitright = true -- open new horizontal split right
|
||||
-- o.smartindent = true
|
||||
-- o.wrap = false
|
||||
--
|
||||
-- -- Highlight search
|
||||
-- o.hlsearch = true
|
||||
-- o.incsearch = true
|
||||
--
|
||||
-- -- No vim backup files
|
||||
-- o.backup = false
|
||||
-- o.swapfile = false
|
||||
--
|
||||
-- -- Scrolling settings
|
||||
-- o.scrolloff = 8
|
||||
-- o.colorcolumn = '120'
|
||||
--
|
||||
-- o.timeoutlen = 500
|
||||
--
|
||||
-- -- Spell check
|
||||
-- opt.spelllang = 'en_us'
|
||||
-- -- opt.spell = true
|
||||
--
|
||||
-- -- Markdown
|
||||
-- global.mkdp_browser = '/usr/bin/firefox'
|
||||
--
|
||||
-- -- Fold
|
||||
-- --o.foldmethod = 'syntax'
|
||||
-- -- o.foldmethod = 'expr'
|
||||
-- -- o.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
-- -- o.foldlevel = 1
|
||||
-- -- o.foldnestmax = 1
|
||||
-- -- o.nofoldenable = false
|
||||
-- opt.foldmethod = 'indent'
|
||||
-- opt.foldenable = false
|
||||
-- opt.foldlevel = 99
|
||||
-- global.markdown_folding = 1
|
||||
--
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
return {
|
||||
"github/copilot.vim",
|
||||
config = function()
|
||||
vim.api.nvim_set_keymap("i", "<C-J>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
|
||||
vim.api.nvim_set_keymap("i", "<C-l>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
|
||||
vim.keymap.set('i', '<C-j>', '<Plug>(copilot-next)', { noremap = false })
|
||||
vim.keymap.set('i', '<C-k>', '<Plug>(copilot-previous)', { noremap = false })
|
||||
vim.keymap.set('i', '<M-.>', '<Plug>(copilot-suggest)', { noremap = false })
|
||||
end
|
||||
}
|
||||
|
|
|
@ -9,7 +9,28 @@ return {
|
|||
"nvim-treesitter/nvim-treesitter",
|
||||
},
|
||||
config = function()
|
||||
require("go").setup()
|
||||
require("go").setup({
|
||||
-- lsp_codelens = true,
|
||||
-- lsp_cfg = true,
|
||||
-- log_path = "/tmp/gonvim.log",
|
||||
-- verbose = true,
|
||||
run_in_floaterm = true,
|
||||
|
||||
-- lsp_on_client_start = function(client, bufnr)
|
||||
-- require('config.keymap').go_on_attach(client, bufnr)
|
||||
-- require('lsp_signature').on_attach()
|
||||
--
|
||||
-- local nmap = function(keys, func, desc)
|
||||
-- if desc then
|
||||
-- desc = 'LSP: ' .. desc
|
||||
-- end
|
||||
--
|
||||
-- vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc })
|
||||
-- end
|
||||
-- -- nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
||||
-- -- vim.lsp.codelens.refresh()
|
||||
-- end,
|
||||
})
|
||||
|
||||
local gofmt = require("go.format")
|
||||
|
||||
|
@ -19,3 +40,4 @@ return {
|
|||
ft = { "go", 'gomod' },
|
||||
build = ':lua require("go.install").update_all_sync()' -- if you need to install/update all binaries
|
||||
}
|
||||
-- return {}
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
return {
|
||||
'olexsmir/gopher.nvim',
|
||||
ft = 'go',
|
||||
config = function(_, opts)
|
||||
require('gopher').setup(opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>gsj", "<CMD>GoTagAdd json<CR>", { desc = '[G]o add [S]truct [J]SON' })
|
||||
end,
|
||||
build = function()
|
||||
vim.cmd [[silent! GoInstallDeps]]
|
||||
end,
|
||||
}
|
||||
-- return {
|
||||
-- 'olexsmir/gopher.nvim',
|
||||
-- ft = 'go',
|
||||
-- config = function(_, opts)
|
||||
-- require('gopher').setup(opts)
|
||||
--
|
||||
-- vim.keymap.set("n", "<leader>gsj", "<CMD>GoTagAdd json<CR>", { desc = '[G]o add [S]truct [J]SON' })
|
||||
-- end,
|
||||
-- build = function()
|
||||
-- vim.cmd [[silent! GoInstallDeps]]
|
||||
-- end,
|
||||
-- }
|
||||
return {}
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
return {
|
||||
'rmagatti/goto-preview',
|
||||
config = function()
|
||||
require('goto-preview').setup {}
|
||||
local goto = require('goto-preview')
|
||||
goto.setup{}
|
||||
|
||||
vim.keymap.set("n", "gpd", goto.goto_preview_definition, { noremap = true, desc = "Goto Preview Definition" })
|
||||
vim.keymap.set("n", "gpt", goto.goto_preview_type_definition, { noremap = true, desc = "Goto Preview Type Definition" })
|
||||
vim.keymap.set("n", "gpi", goto.goto_preview_implementation, { noremap = true, desc = "Goto Preview Implementation" })
|
||||
vim.keymap.set("n", "gP", goto.close_all_win, { noremap = true, desc = "Close All Preview Windows" })
|
||||
vim.keymap.set("n", "gpr", goto.goto_preview_references, { noremap = true, desc = "Goto Preview References" })
|
||||
end
|
||||
}
|
||||
|
|
|
@ -9,6 +9,7 @@ return {
|
|||
sources = {
|
||||
-- null_ls.builtins.formatting.goimports_reviser,
|
||||
null_ls.builtins.formatting.gofumpt,
|
||||
-- null_ls.builtins.formatting.stylua,
|
||||
-- null_ls.builtins.formatting.golines,
|
||||
},
|
||||
on_attach = function(client, bufnr)
|
||||
|
|
|
@ -3,7 +3,7 @@ return {
|
|||
-- enabled = false,
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
commit = "8b62563",
|
||||
ft = "http",
|
||||
ft = { "http", "rest" },
|
||||
config = function()
|
||||
local rest_nvim = require "rest-nvim"
|
||||
|
||||
|
|
|
@ -3,30 +3,35 @@ return {
|
|||
config = function(_, opts)
|
||||
require('trouble').setup(opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>",
|
||||
{ silent = true, noremap = true }
|
||||
)
|
||||
|
||||
-- vim.keymap.set("n", "<leader>xx", "<cmd>TroubleToggle<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
-- vim.keymap.set("n", "<leader>xw", "<cmd>TroubleToggle workspace_diagnostics<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
-- vim.keymap.set("n", "<leader>xd", "<cmd>TroubleToggle document_diagnostics<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
-- vim.keymap.set("n", "<leader>xl", "<cmd>TroubleToggle loclist<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
-- vim.keymap.set("n", "<leader>xq", "<cmd>TroubleToggle quickfix<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
-- vim.keymap.set("n", "gR", "<cmd>TroubleToggle lsp_references<cr>",
|
||||
-- { silent = true, noremap = true }
|
||||
-- )
|
||||
vim.keymap.set("n", "<leader>xx", function() require("trouble").toggle() end)
|
||||
vim.keymap.set("n", "<leader>xw", function() require("trouble").toggle("workspace_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xd", function() require("trouble").toggle("document_diagnostics") end)
|
||||
vim.keymap.set("n", "<leader>xq", function() require("trouble").toggle("quickfix") end)
|
||||
vim.keymap.set("n", "<leader>xl", function() require("trouble").toggle("loclist") end)
|
||||
end,
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
use_diagnostic_signs = false,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -165,3 +165,52 @@ Firestore
|
|||
OpenAI
|
||||
firestore
|
||||
LiveData
|
||||
func
|
||||
http
|
||||
INIT
|
||||
contentListProcess
|
||||
ServeHTTP
|
||||
InitVars
|
||||
AvoidCrash
|
||||
statusCode
|
||||
TODO
|
||||
ResponseMessage
|
||||
InternalControl
|
||||
ResponseCode
|
||||
RequestIndex
|
||||
StatusText
|
||||
Sprintf
|
||||
fmt
|
||||
argContentListInfo
|
||||
ErrorListDetail
|
||||
utils
|
||||
AppendError
|
||||
NewPtr
|
||||
MethodDelete
|
||||
cmdAction
|
||||
herrors
|
||||
MethodPut
|
||||
MethodPatch
|
||||
Newf
|
||||
ToLower
|
||||
ValStringDef
|
||||
WithCode
|
||||
StatusBadRequest
|
||||
UPSERT
|
||||
const
|
||||
UpperCase
|
||||
paramID
|
||||
endregion
|
||||
critial
|
||||
GCE
|
||||
TError
|
||||
GetError
|
||||
NOK
|
||||
bacause
|
||||
contentHandle
|
||||
Params
|
||||
contentListInfo
|
||||
ParseContent
|
||||
StatusInternalServerError
|
||||
parentID
|
||||
GENOS
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue