mirror of
https://github.com/d0zingcat/dotfiles.git
synced 2026-05-14 07:26:44 +00:00
@@ -1,32 +0,0 @@
|
||||
require('gitsigns').setup({
|
||||
signs = {
|
||||
add = { hl = 'GitSignsAdd', text = '┋', numhl = 'GitSignsAddNr', linehl = 'GitSignsAddLn' },
|
||||
change = { hl = 'GitSignsChange', text = '┋', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||
delete = { hl = 'GitSignsDelete', text = '⇉', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||
topdelete = { hl = 'GitSignsDelete', text = '⇊', numhl = 'GitSignsDeleteNr', linehl = 'GitSignsDeleteLn' },
|
||||
changedelete = { hl = 'GitSignsChange', text = '~', numhl = 'GitSignsChangeNr', linehl = 'GitSignsChangeLn' },
|
||||
},
|
||||
-- keymaps = {
|
||||
-- -- Default keymap options
|
||||
-- noremap = true,
|
||||
-- ['n ]c'] = { expr = true, "&diff ? ']c' : '<cmd>lua require\"gitsigns.actions\".next_hunk()<CR>'" },
|
||||
-- ['n [c'] = { expr = true, "&diff ? '[c' : '<cmd>lua require\"gitsigns.actions\".prev_hunk()<CR>'" },
|
||||
-- },
|
||||
word_diff = false,
|
||||
current_line_blame = true,
|
||||
linehl = true,
|
||||
numhl = true,
|
||||
sign_priority = 6,
|
||||
count_chars = {
|
||||
[1] = '1', -- '₁',
|
||||
[2] = '2', -- '₂',
|
||||
[3] = '3', -- '₃',
|
||||
[4] = '4', -- '₄',
|
||||
[5] = '5', -- '₅',
|
||||
[6] = '6', -- '₆',
|
||||
[7] = '7', -- '₇',
|
||||
[8] = '8', -- '₈',
|
||||
[9] = '9', -- '₉',
|
||||
['+'] = '', -- '₊',
|
||||
},
|
||||
})
|
||||
@@ -1,7 +0,0 @@
|
||||
require('ibl').setup()
|
||||
-- setup({
|
||||
-- char = '|',
|
||||
-- buftype_exclude = { 'terminal' },
|
||||
-- show_trailing_blankline_indent = false,
|
||||
-- show_current_context = true,
|
||||
-- })
|
||||
@@ -1,101 +0,0 @@
|
||||
local utils = require('lsp-setup.utils')
|
||||
local nvim_lsp = require('lspconfig')
|
||||
local mappings = {
|
||||
-- Example mappings for telescope pickers
|
||||
gd = 'lua require"telescope.builtin".lsp_definitions({jump_type="vsplit"})',
|
||||
gi = 'lua require"telescope.builtin".lsp_implementations({jump_type="vsplit"})',
|
||||
gr = 'lua require"telescope.builtin".lsp_references({jump_type="vsplit"})',
|
||||
go = 'lua require"telescope.builtin".lsp_document_symbols({jump_type="vsplit"})',
|
||||
['<space>f'] = 'lua vim.lsp.buf.format({async=true})',
|
||||
}
|
||||
|
||||
require("neodev").setup({
|
||||
-- add any options here, or leave empty to use the default settings
|
||||
})
|
||||
|
||||
local servers = {
|
||||
lua_ls = {},
|
||||
bashls = {},
|
||||
helm_ls = {},
|
||||
yamlls = {
|
||||
filetypes = { 'yaml', 'yml' },
|
||||
settings = {
|
||||
yaml = {
|
||||
schemas = {
|
||||
['https://json.schemastore.org/github-workflow.json'] = '/.github/workflows/*',
|
||||
['https://raw.githubusercontent.com/OAI/OpenAPI-Specification/main/schemas/v2.0/schema.json'] = {
|
||||
'/*swagger.yaml',
|
||||
'/*swagger.yml',
|
||||
},
|
||||
Kubernetes = {
|
||||
'/*ing.yaml',
|
||||
'/*deploy.yaml',
|
||||
'/*sts.yaml',
|
||||
'/*cm.yaml',
|
||||
'/*secret.yaml',
|
||||
'/*kustomization.yaml',
|
||||
'/*svc.yaml',
|
||||
},
|
||||
--['https://raw.githubusercontent.com/instrumenta/kubernetes-json-schema/master/v1.18.0-standalone-strict/all.json'] = '/*.k8s.yaml',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
eslint = {},
|
||||
jsonls = {},
|
||||
clangd = {},
|
||||
gopls = {
|
||||
settings = {
|
||||
gopls = {
|
||||
gofumpt = true,
|
||||
usePlaceholders = true,
|
||||
staticcheck = true,
|
||||
codelenses = {
|
||||
gc_details = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
tsserver = {},
|
||||
prosemd_lsp = {},
|
||||
|
||||
pylsp = {},
|
||||
rust_analyzer = {
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
cargo = {
|
||||
loadOutDirsFromCheck = true,
|
||||
},
|
||||
procMacro = {
|
||||
enable = true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
terraformls = {},
|
||||
-- beancount = {
|
||||
-- -- filetypes = { 'beancount', 'bean' },
|
||||
-- cmd = { "beancount-language-server", "--stdio", },
|
||||
-- init_options = {
|
||||
-- journalFile = ""
|
||||
-- },
|
||||
-- filetypes = { "beancount", "bean" },
|
||||
-- root_dir = nvim_lsp.util.root_pattern("main.bean"),
|
||||
-- single_file_support = true,
|
||||
-- }
|
||||
}
|
||||
|
||||
local settings = {
|
||||
default_mappings = true,
|
||||
mappings = mappings,
|
||||
servers = servers,
|
||||
}
|
||||
|
||||
require('lsp-setup').setup(settings)
|
||||
|
||||
-- require('lsp_signature').setup({})
|
||||
require('lsp-colors').setup({})
|
||||
|
||||
local border = { '╭', '─', '╮', '│', '╯', '─', '╰', '│' }
|
||||
vim.lsp.handlers['textDocument/hover'] = vim.lsp.with(vim.lsp.handlers.hover, { border = border })
|
||||
vim.lsp.handlers['textDocument/signatureHelp'] = vim.lsp.with(vim.lsp.handlers.signature_help, { border = border })
|
||||
@@ -1,5 +0,0 @@
|
||||
require('lsp_lines').setup()
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
})
|
||||
@@ -1,106 +0,0 @@
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'auto',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff', 'diagnostics' },
|
||||
lualine_c = { 'filename', 'lsp_progress' },
|
||||
lualine_x = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
})
|
||||
|
||||
local colors = {
|
||||
yellow = '#ECBE7B',
|
||||
cyan = '#008080',
|
||||
darkblue = '#081633',
|
||||
green = '#98be65',
|
||||
orange = '#FF8800',
|
||||
violet = '#a9a1e1',
|
||||
magenta = '#c678dd',
|
||||
blue = '#51afef',
|
||||
red = '#ec5f67',
|
||||
}
|
||||
|
||||
local config = {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = { '', '' },
|
||||
section_separators = { '', '' },
|
||||
disabled_filetypes = {},
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'filename' },
|
||||
lualine_c = {},
|
||||
lualine_x = {},
|
||||
lualine_y = { 'encoding', 'fileformat', 'filetype' },
|
||||
lualine_z = { 'branch' },
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {},
|
||||
}
|
||||
|
||||
-- Inserts a component in lualine_c at left section
|
||||
local function ins_left(component)
|
||||
table.insert(config.sections.lualine_c, component)
|
||||
end
|
||||
|
||||
-- Inserts a component in lualine_x ot right section
|
||||
local function ins_right(component)
|
||||
table.insert(config.sections.lualine_x, component)
|
||||
end
|
||||
|
||||
--ins_left {
|
||||
--'lsp_progress',
|
||||
--display_components = { 'lsp_client_name', { 'title', 'percentage', 'message' }},
|
||||
---- With spinner
|
||||
---- display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' }},
|
||||
--colors = {
|
||||
--percentage = colors.cyan,
|
||||
--title = colors.cyan,
|
||||
--message = colors.cyan,
|
||||
--spinner = colors.cyan,
|
||||
--lsp_client_name = colors.magenta,
|
||||
--use = true,
|
||||
--},
|
||||
--separators = {
|
||||
--component = ' ',
|
||||
--progress = ' | ',
|
||||
--message = { pre = '(', post = ')'},
|
||||
--percentage = { pre = '', post = '%% ' },
|
||||
--title = { pre = '', post = ': ' },
|
||||
--lsp_client_name = { pre = '[', post = ']' },
|
||||
--spinner = { pre = '', post = '' },
|
||||
--message = { commenced = 'In Progress', completed = 'Completed' },
|
||||
--},
|
||||
--display_components = { 'lsp_client_name', 'spinner', { 'title', 'percentage', 'message' } },
|
||||
--timer = { progress_enddelay = 500, spinner = 1000, lsp_client_name_enddelay = 1000 },
|
||||
--spinner_symbols = { '🌑 ', '🌒 ', '🌓 ', '🌔 ', '🌕 ', '🌖 ', '🌗 ', '🌘 ' },
|
||||
--}
|
||||
@@ -1,25 +0,0 @@
|
||||
local g = vim.g
|
||||
|
||||
local border_chars = {
|
||||
TOP_LEFT = '╭',
|
||||
TOP_RIGHT = '╮',
|
||||
MID_HORIZONTAL = '─',
|
||||
MID_VERTICAL = '│',
|
||||
BOTTOM_LEFT = '╰',
|
||||
BOTTOM_RIGHT = '╯',
|
||||
}
|
||||
|
||||
g.lsp_utils_location_opts = {
|
||||
mode = 'split',
|
||||
preview = {
|
||||
title = 'Location Preview',
|
||||
border = true,
|
||||
border_chars = border_chars,
|
||||
},
|
||||
keymaps = {
|
||||
n = {
|
||||
['<C-n>'] = 'j',
|
||||
['<C-p>'] = 'k',
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1,104 +0,0 @@
|
||||
local function open_nvim_tree(data)
|
||||
-- buffer is a real file on the disk
|
||||
local real_file = vim.fn.filereadable(data.file) == 1
|
||||
|
||||
-- buffer is a [No Name]
|
||||
local no_name = data.file == "" and vim.bo[data.buf].buftype == ""
|
||||
|
||||
-- buffer is a directory
|
||||
local directory = vim.fn.isdirectory(data.file) == 1
|
||||
|
||||
if directory then
|
||||
-- create a new, empty buffer
|
||||
vim.cmd.enew()
|
||||
|
||||
-- wipe the directory buffer
|
||||
vim.cmd.bw(data.buf)
|
||||
|
||||
-- change to the directory
|
||||
vim.cmd.cd(data.file)
|
||||
|
||||
-- open the tree
|
||||
require("nvim-tree.api").tree.open()
|
||||
end
|
||||
|
||||
if real_file or no_name then
|
||||
-- open the tree, find the file but don't focus it
|
||||
require("nvim-tree.api").tree.toggle({ focus = false, find_file = true, })
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
--- autocmd with callbacks
|
||||
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree })
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
group = vim.api.nvim_create_augroup("NvimTreeClose", { clear = true }),
|
||||
pattern = "NvimTree_*",
|
||||
callback = function()
|
||||
local layout = vim.api.nvim_call_function("winlayout", {})
|
||||
if layout[1] == "leaf" and
|
||||
vim.api.nvim_buf_get_option(vim.api.nvim_win_get_buf(layout[2]), "filetype") == "NvimTree" and
|
||||
layout[3] == nil then vim.cmd("confirm quit") end
|
||||
end
|
||||
})
|
||||
|
||||
local function on_attach(bufnr)
|
||||
local api = require('nvim-tree.api')
|
||||
|
||||
local function opts(desc)
|
||||
return { desc = 'nvim-tree: ' .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
|
||||
end
|
||||
|
||||
api.config.mappings.default_on_attach(bufnr)
|
||||
-- Mappings migrated from view.mappings.list
|
||||
-- You will need to insert "your code goes here" for any mappings with a custom action_cb
|
||||
vim.keymap.set('n', '<C-v>', api.node.open.vertical, opts('Open: Vertical Split'))
|
||||
vim.keymap.set('n', '<C-s>', api.node.open.horizontal, opts('Open: Horizontal Split'))
|
||||
vim.keymap.set('n', 'v', api.node.open.vertical, opts('Open: Vertical Split'))
|
||||
vim.keymap.set('n', 's', api.node.open.horizontal, opts('Open: Horizontal Split'))
|
||||
vim.keymap.set('n', 'P', function()
|
||||
local node = api.tree.get_node_under_cursor()
|
||||
print(node.absolute_path)
|
||||
end, opts('Print Node Path'))
|
||||
end
|
||||
|
||||
require('nvim-tree').setup({
|
||||
view = {
|
||||
width = 35,
|
||||
side = 'left',
|
||||
},
|
||||
-- renderer = {
|
||||
-- highlight_opened_files = '1',
|
||||
-- },
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
error = '',
|
||||
warning = '',
|
||||
info = '',
|
||||
hint = '',
|
||||
},
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true,
|
||||
},
|
||||
filters = {
|
||||
custom = {
|
||||
'.git$'
|
||||
},
|
||||
},
|
||||
hijack_netrw = true,
|
||||
update_cwd = true,
|
||||
on_attach = on_attach,
|
||||
})
|
||||
|
||||
-- map('n', '<leader>te', ':NvimTreeToggle<CR>')
|
||||
|
||||
-- vim.cmd([[
|
||||
-- autocmd BufEnter * ++nested if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif
|
||||
-- augroup nvimtree
|
||||
-- autocmd VimEnter * lua require('nvim-tree').toggle(false, true)
|
||||
-- augroup END
|
||||
-- ]])
|
||||
@@ -1,18 +0,0 @@
|
||||
local cmd = vim.cmd
|
||||
local g = vim.g
|
||||
local map = require('utils').map
|
||||
|
||||
-- vim-bookmarks
|
||||
require('telescope').load_extension('vim_bookmarks')
|
||||
|
||||
g['bookmark_sign'] = '⚑'
|
||||
g['bookmark_highlight_lines'] = 1
|
||||
g['bookmark_no_default_key_mappings'] = 1
|
||||
|
||||
cmd([[highlight BookmarkSign ctermbg=NONE ctermfg=160]])
|
||||
cmd([[highlight BookmarkLine ctermbg=194 ctermfg=NONE]])
|
||||
|
||||
map('n', 'mm', ':BookmarkToggle<CR>')
|
||||
map('n', 'mA', ':Telescope vim_bookmarks all<CR>')
|
||||
map('n', 'ma', ':Telescope vim_bookmarks current_file<CR>')
|
||||
-- map("n", "ma", ":BookmarkShowAll<CR>")
|
||||
@@ -1,45 +0,0 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- nvim-cmp
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
fn['vsnip#anonymous'](args.body)
|
||||
end,
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- set a name for each source
|
||||
vim_item.menu = ({
|
||||
buffer = '[Buf]',
|
||||
nvim_lsp = '[LSP]',
|
||||
luasnip = '[Snip]',
|
||||
nvim_lua = '[Lua]',
|
||||
latex_symbols = '[Latex]',
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
-- ['<C-e>'] = cmp.mapping.complete(),
|
||||
--["<C-e>"] = cmp.mapping.close(),
|
||||
['<C-e>'] = function(fallback)
|
||||
fallback()
|
||||
end,
|
||||
-- ['<CR>'] = cmp.mapping.confirm({
|
||||
-- behavior = cmp.ConfirmBehavior.Replace,
|
||||
-- select = true,
|
||||
-- }),
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
-- ['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- ['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
--},
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
})
|
||||
@@ -1,14 +0,0 @@
|
||||
local g = vim.g
|
||||
local map = require('utils').map
|
||||
|
||||
-- floaterm
|
||||
g['floaterm_keymap_new'] = '<F7>'
|
||||
g['floaterm_keymap_next'] = '<F8>'
|
||||
g['floaterm_keymap_prev'] = '<F9>'
|
||||
g['floaterm_keymap_toggle'] = '<F10>'
|
||||
g['floaterm_position'] = 'bottomright'
|
||||
map('t', '<Esc>', '<c-\\><c-n>')
|
||||
map('n', '<leader>t', 'V:FloatermSend<CR>:FloatermToggle<CR>')
|
||||
map('v', '<leader>t', ':FloatermSend<CR>:FloatermToggle<CR>')
|
||||
map('n', '<leader>r', 'V:FloatermSend<CR>:FloatermToggle<CR>')
|
||||
map('v', '<leader>r', ':FloatermSend<CR>:FloatermToggle<CR>')
|
||||
@@ -1,15 +0,0 @@
|
||||
local map = require('utils').map
|
||||
|
||||
-- hopworld
|
||||
require('hop').setup({ keys = 'etovxqpdygfblzhckisuran' })
|
||||
|
||||
map('n', '<leader>fw', '<cmd>HopWord<cr>')
|
||||
map('n', '<leader>s', '<cmd>HopChar1<cr>')
|
||||
map('n', '<leader>h', '<cmd>HopWordBC<cr>')
|
||||
map('n', '<leader>j', '<cmd>HopLineStartAC<cr>')
|
||||
map('n', '<leader>k', '<cmd>HopLineStartBC<cr>')
|
||||
map('n', '<leader>l', '<cmd>HopWordAC<cr>')
|
||||
map('v', '<leader>h', '<cmd>HopWordBC<cr>')
|
||||
map('v', '<leader>j', '<cmd>HopLineStartAC<cr>')
|
||||
map('v', '<leader>k', '<cmd>HopLineStartBC<cr>')
|
||||
map('v', '<leader>l', '<cmd>HopWordAC<cr>')
|
||||
@@ -1,37 +0,0 @@
|
||||
local map = require('utils').map
|
||||
|
||||
-- telescope
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
layout_config = {
|
||||
horizontal = {
|
||||
width = 0.75,
|
||||
height = 0.6,
|
||||
},
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
['<esc>'] = actions.close,
|
||||
['<C-k>'] = actions.move_selection_previous,
|
||||
['<C-j>'] = actions.move_selection_next,
|
||||
['<C-l>'] = { '<Right>', type = 'command' },
|
||||
['<C-h>'] = { '<Left>', type = 'command' },
|
||||
['<C-f>'] = actions.preview_scrolling_down,
|
||||
['<C-b>'] = actions.preview_scrolling_up,
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
map('n', '<leader>ff', builtin.find_files)
|
||||
-- map('n', '<leader>fg', [[:lua require('telescope.builtin').live_grep({additional_args = {'-j8'}})<CR>]])
|
||||
map('n', '<leader>fb', builtin.buffers)
|
||||
map('n', '<leader>fg', function() builtin.live_grep({ additional_args = { '-j8' } }) end)
|
||||
map('n', '<leader>fh', builtin.help_tags)
|
||||
map('n', '<leader>;', builtin.commands)
|
||||
|
||||
-- To get fzf loaded and working with telescope, you need to call
|
||||
-- load_extension, somewhere after setup function:
|
||||
require('telescope').load_extension('fzf')
|
||||
@@ -1,51 +0,0 @@
|
||||
local ncmd = vim.api.nvim_command
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { 'c', 'lua', 'rust', 'go', 'python', 'zig', 'markdown', 'solidity', 'jsonnet', 'vim',
|
||||
'javascript', 'typescript' },
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
playground = {
|
||||
enable = true,
|
||||
},
|
||||
query_linter = {
|
||||
enable = true,
|
||||
use_virtual_text = true,
|
||||
lint_events = { 'BufWrite', 'CursorHold' },
|
||||
},
|
||||
-- nvim-treesitter/nvim-treesitter-refactor
|
||||
refactor = {
|
||||
highlight_definitions = { enable = true },
|
||||
smart_rename = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
smart_rename = 'gnr',
|
||||
},
|
||||
},
|
||||
},
|
||||
indent = { enable = false },
|
||||
autopairs = { enable = true },
|
||||
rainbow = { enable = true },
|
||||
autotag = { enable = true },
|
||||
context_commentstring = { enable = true },
|
||||
-- RRethy/nvim-treesitter-endwise
|
||||
endwise = {
|
||||
enable = true,
|
||||
},
|
||||
-- andymass/vim-matchup
|
||||
matchup = {
|
||||
enable = true,
|
||||
},
|
||||
-- nvim-treesitter/nvim-treesitter-textobjects
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
lookahead = true,
|
||||
},
|
||||
},
|
||||
-- yioneko/nvim-yati
|
||||
yati = { enable = true },
|
||||
})
|
||||
ncmd('set foldmethod=expr')
|
||||
ncmd('set foldexpr=nvim_treesitter#foldexpr()')
|
||||
@@ -1,21 +0,0 @@
|
||||
local g = vim.g
|
||||
|
||||
-- vim-go
|
||||
-- let g:go_code_completion_enabled = 1 -- Enable Autocompletion
|
||||
--g['go_fmt_command'] = 'goimports' -- 格式化将默认的 gofmt 替换
|
||||
g['go_autodetect_gopath'] = 1
|
||||
g['go_list_type'] = 'quickfix'
|
||||
g['go_version_warning'] = 1
|
||||
g['go_highlight_types'] = 1
|
||||
g['go_highlight_fields'] = 1
|
||||
g['go_highlight_functions'] = 1
|
||||
g['go_highlight_function_calls'] = 1
|
||||
g['go_highlight_operators'] = 1
|
||||
g['go_highlight_extra_types'] = 1
|
||||
g['go_highlight_methods'] = 1
|
||||
g['go_highlight_generate_tags'] = 1
|
||||
g['godef_split'] = 2
|
||||
--g['go_fmt_command'] = 'goimports' " Run goimports along gofmt on each save
|
||||
g['go_imports_mode'] = 'goimports'
|
||||
g['go_imports_autosave'] = 0 -- do not auto import
|
||||
g['go_auto_type_info'] = 1 -- automatically get signature/type info for object under cursor
|
||||
@@ -1,272 +0,0 @@
|
||||
local fn = vim.fn
|
||||
local g = vim.g
|
||||
local cmd = vim.cmd
|
||||
local lsp = vim.lsp
|
||||
local api = vim.api
|
||||
local map = require('utils').map
|
||||
|
||||
-- Ensure packer installed
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
cmd('packadd packer.nvim')
|
||||
end
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use('wbthomason/packer.nvim')
|
||||
use('nvim-lua/plenary.nvim')
|
||||
|
||||
use('folke/tokyonight.nvim')
|
||||
use('tpope/vim-fugitive') -- git fugitive
|
||||
use({
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
require('config.gitsigns')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'folke/which-key.nvim',
|
||||
config = function()
|
||||
require('which-key').setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'folke/trouble.nvim',
|
||||
config = function()
|
||||
require('config.trouble')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
config = function()
|
||||
require('config.indent-blankline')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'MattesGroeger/vim-bookmarks',
|
||||
requires = 'tom-anders/telescope-vim-bookmarks.nvim',
|
||||
config = function()
|
||||
require('config.nvim_bookmarks')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'ojroques/vim-oscyank',
|
||||
config = function()
|
||||
require('config.vim-oscyank')
|
||||
end,
|
||||
})
|
||||
use('junegunn/vim-easy-align') -- 可以快速对齐的插件
|
||||
use({
|
||||
't9md/vim-choosewin',
|
||||
})
|
||||
use({
|
||||
'akinsho/toggleterm.nvim',
|
||||
config = function()
|
||||
require('config.toggleterm')
|
||||
end,
|
||||
})
|
||||
use('wakatime/vim-wakatime')
|
||||
use({
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'windwp/nvim-autopairs',
|
||||
config = function()
|
||||
-- nvim-autopairs
|
||||
require('nvim-autopairs').setup({})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
config = function()
|
||||
require('config.nvim-tree')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = function()
|
||||
require('config.nvim_telescope')
|
||||
end,
|
||||
requires = {
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'make',
|
||||
config = function()
|
||||
require('telescope').load_extension('fzf')
|
||||
end
|
||||
}
|
||||
},
|
||||
})
|
||||
use({
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
require('config.nvim_cmp')
|
||||
end,
|
||||
requires = {
|
||||
'hrsh7th/cmp-vsnip',
|
||||
'hrsh7th/vim-vsnip',
|
||||
'hrsh7th/vim-vsnip-integ',
|
||||
},
|
||||
})
|
||||
use('hrsh7th/cmp-buffer')
|
||||
use({
|
||||
'folke/lsp-colors.nvim',
|
||||
config = function()
|
||||
require('lsp-colors').setup({})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'RishabhRD/nvim-lsputils',
|
||||
config = function()
|
||||
require('config.nvim-lsputils')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
|
||||
config = function()
|
||||
require('config.lsp_lines')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'github/copilot.vim',
|
||||
setup = function()
|
||||
vim.g.copilot_no_tab_map = 1
|
||||
vim.g.copilot_no_maps = 1
|
||||
vim.g.copilot_assume_mapped = 1
|
||||
end,
|
||||
config = function()
|
||||
local map = require('utils').map
|
||||
map('i', '<C-e>', 'copilot#Accept()', { expr = true })
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
config = function()
|
||||
require('config.nvim_treesitter')
|
||||
end,
|
||||
requires = {
|
||||
'nvim-treesitter/playground',
|
||||
'nvim-treesitter/nvim-treesitter-refactor',
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
'nvim-treesitter/nvim-treesitter-context',
|
||||
'RRethy/nvim-treesitter-endwise',
|
||||
'andymass/vim-matchup', -- extend % key
|
||||
'yioneko/nvim-yati',
|
||||
'm-demare/hlargs.nvim',
|
||||
},
|
||||
})
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = function() vim.fn["mkdp#util#install"]() end,
|
||||
})
|
||||
|
||||
use({
|
||||
"iamcco/markdown-preview.nvim",
|
||||
run = "cd app && npm install",
|
||||
setup = function() vim.g.mkdp_filetypes = { "markdown" } end,
|
||||
ft = { "markdown" },
|
||||
})
|
||||
use({
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||
config = function()
|
||||
require('config.lualine')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'j-hui/fidget.nvim',
|
||||
config = function()
|
||||
require('fidget').setup({})
|
||||
end,
|
||||
})
|
||||
-- use 'arkav/lualine-lsp-progress'
|
||||
use({
|
||||
'romgrk/barbar.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons' },
|
||||
})
|
||||
use({
|
||||
'folke/todo-comments.nvim',
|
||||
config = function()
|
||||
require('todo-comments').setup({})
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'phaazon/hop.nvim',
|
||||
as = 'hop',
|
||||
config = function()
|
||||
-- you can configure Hop the way you like here; see :h hop-config
|
||||
require('config.nvim_hop')
|
||||
end,
|
||||
})
|
||||
use({
|
||||
'preservim/tagbar',
|
||||
config = function()
|
||||
require('config.tagbar')
|
||||
end,
|
||||
})
|
||||
|
||||
-- BETTER editor
|
||||
use({
|
||||
'vinnymeller/swagger-preview.nvim',
|
||||
run = "npm install -g swagger-ui-watcher",
|
||||
config = function()
|
||||
require("swagger-preview").setup({
|
||||
-- The port to run the preview server on
|
||||
port = 9000,
|
||||
-- The host to run the preview server on
|
||||
host = "localhost",
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
||||
-- LANGUAGES
|
||||
use({
|
||||
'Junnplus/lsp-setup.nvim',
|
||||
config = function()
|
||||
require('config.lsp-setup')
|
||||
end,
|
||||
requires = {
|
||||
'neovim/nvim-lspconfig',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'folke/lsp-colors.nvim',
|
||||
'folke/neodev.nvim',
|
||||
'ray-x/lsp_signature.nvim',
|
||||
|
||||
'RRethy/vim-illuminate',
|
||||
'simrat39/rust-tools.nvim',
|
||||
'p00f/clangd_extensions.nvim',
|
||||
},
|
||||
})
|
||||
-- k8s
|
||||
-- use('andrewstuart/vim-kubernetes')
|
||||
|
||||
-- go
|
||||
use({
|
||||
'fatih/vim-go',
|
||||
run = ':GoUpdateBinaries',
|
||||
config = function()
|
||||
require('config.nvim_vimgo')
|
||||
end,
|
||||
})
|
||||
-- erlang
|
||||
use('vim-erlang/vim-erlang-tags')
|
||||
use('iamcco/mathjax-support-for-mkdp')
|
||||
--beancount
|
||||
-- use('nathangrigg/vim-beancount')
|
||||
-- python
|
||||
use('Vimjas/vim-python-pep8-indent')
|
||||
-- rust
|
||||
use('rust-lang/rust.vim')
|
||||
use('mfussenegger/nvim-dap')
|
||||
end)
|
||||
@@ -1,15 +0,0 @@
|
||||
local g = vim.g
|
||||
local map = require('utils').map
|
||||
|
||||
map('t', '<C-]>', [[<C-\><C-n>]], { noremap = true })
|
||||
|
||||
require('toggleterm').setup({
|
||||
open_mapping = [[<C-t>]],
|
||||
size = function(term)
|
||||
if term.direction == 'horizontal' then
|
||||
return 15
|
||||
else
|
||||
return vim.o.columns * 0.3
|
||||
end
|
||||
end,
|
||||
})
|
||||
@@ -1,5 +0,0 @@
|
||||
require('trouble').setup({
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
})
|
||||
@@ -1,4 +0,0 @@
|
||||
local map = require('utils').map
|
||||
|
||||
map('v', '<leader>yy', ':OSCYank<CR>')
|
||||
map('n', '<leader>o', '<Plug>OSCYank')
|
||||
@@ -1,15 +0,0 @@
|
||||
local api = vim.api
|
||||
|
||||
api.nvim_exec(
|
||||
[[
|
||||
" Ensure you have installed some decent font to show these pretty symbols, then you can enable icon for the kind.
|
||||
let g:vista#renderer#enable_icon = 1
|
||||
|
||||
" The default icons can't be suitable for all the filetypes, you can extend it as you wish.
|
||||
let g:vista#renderer#icons = {
|
||||
\ "function": "\uf794",
|
||||
\ "variable": "\uf71b",
|
||||
\ }
|
||||
]],
|
||||
false
|
||||
)
|
||||
23
nvim/lua/plugins/avante.lua
Normal file
23
nvim/lua/plugins/avante.lua
Normal file
@@ -0,0 +1,23 @@
|
||||
return {
|
||||
"yetone/avante.nvim",
|
||||
event = "VeryLazy",
|
||||
-- build = "make", -- This is Optional, only if you want to use tiktoken_core to calculate tokens count
|
||||
opts = {
|
||||
-- provider = "claude",
|
||||
provider = "openai",
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons
|
||||
"stevearc/dressing.nvim",
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
--- The below is optional, make sure to setup it properly if you have lazy=true
|
||||
{
|
||||
'MeanderingProgrammer/render-markdown.nvim',
|
||||
opts = {
|
||||
file_types = { "markdown", "Avante" },
|
||||
},
|
||||
ft = { "markdown", "Avante" },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -64,6 +64,8 @@ return {
|
||||
}
|
||||
}
|
||||
},
|
||||
crystalline = {},
|
||||
terraformls = {},
|
||||
jsonls = {},
|
||||
bashls = {},
|
||||
tsserver = {
|
||||
|
||||
@@ -20,6 +20,7 @@ return {
|
||||
vim.api.nvim_create_autocmd('BufEnter', { callback = close_nvim_tree })
|
||||
end,
|
||||
opts = {
|
||||
filters = { dotfiles = false, custom = { '^.git$' } },
|
||||
on_attach = function(bufnr)
|
||||
local function map(mode, l, r, opts)
|
||||
opts = opts or {}
|
||||
|
||||
Reference in New Issue
Block a user