update to lua config
This commit is contained in:
@@ -1,15 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
local lsp_util = vim.lsp.util
|
||||
|
||||
function M.code_action_listener()
|
||||
local context = { diagnostics = vim.lsp.diagnostic.get_line_diagnostics() }
|
||||
local params = lsp_util.make_range_params()
|
||||
params.context = context
|
||||
vim.lsp.buf_request(0, 'textDocument/codeAction', params,
|
||||
function(err, result, ctx, config)
|
||||
-- do something with result - e.g. check if empty and show some indication such as a sign
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
||||
51
lua/core/autocmds.lua
Normal file
51
lua/core/autocmds.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
|
||||
-- Restore cursor position
|
||||
local restore_cursor = augroup('RestoreCursor', { clear = true })
|
||||
autocmd('BufReadPost', {
|
||||
group = restore_cursor,
|
||||
callback = function()
|
||||
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||
local lcount = vim.api.nvim_buf_line_count(0)
|
||||
if mark[1] > 0 and mark[1] <= lcount then
|
||||
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Help and man pages in vertical split
|
||||
local help_config = augroup('HelpConfig', { clear = true })
|
||||
autocmd('FileType', {
|
||||
group = help_config,
|
||||
pattern = { 'help', 'man' },
|
||||
command = 'wincmd L'
|
||||
})
|
||||
|
||||
-- Terminal settings
|
||||
local term_config = augroup('TermConfig', { clear = true })
|
||||
autocmd('TermOpen', {
|
||||
group = term_config,
|
||||
pattern = '*',
|
||||
command = 'setlocal nonumber norelativenumber'
|
||||
})
|
||||
|
||||
local highlight_yank = augroup('HighlightYank', { clear = true })
|
||||
autocmd('TextYankPost', {
|
||||
group = highlight_yank,
|
||||
pattern = '*',
|
||||
callback = function()
|
||||
vim.highlight.on_yank({ higroup = "IncSearch", timeout = 1000 })
|
||||
end,
|
||||
})
|
||||
|
||||
-- Code actions on cursor hold
|
||||
-- local code_action = augroup('CodeAction', { clear = true })
|
||||
-- autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
-- group = code_action,
|
||||
-- callback = function()
|
||||
-- if vim.tbl_isempty(vim.lsp.buf_get_clients()) then
|
||||
-- require('code_action_utils').code_action_listener()
|
||||
-- end
|
||||
-- end
|
||||
-- })
|
||||
158
lua/core/keymaps.lua
Normal file
158
lua/core/keymaps.lua
Normal file
@@ -0,0 +1,158 @@
|
||||
local map = vim.keymap.set
|
||||
local opts = { silent = true, noremap = true }
|
||||
|
||||
-- Leader key
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
-- Custom commands
|
||||
vim.api.nvim_create_user_command('PS', ':PackerSync', {})
|
||||
vim.api.nvim_create_user_command('Reload', 'source ~/.config/nvim/init.lua', {})
|
||||
vim.api.nvim_create_user_command('Config', 'edit ~/.config/nvim/init.lua', {})
|
||||
vim.api.nvim_create_user_command('Plugins', 'edit ~/.config/nvim/lua/core/plugins.lua', {})
|
||||
vim.api.nvim_create_user_command('Keymaps', 'edit ~/.config/nvim/lua/core/keymaps.lua', {})
|
||||
|
||||
-- Basic mappings
|
||||
map('n', '<C-u>', '<C-u>zz', opts)
|
||||
map('n', 'n', 'nzzzv', opts)
|
||||
map('n', 'N', 'Nzzzv', opts)
|
||||
map('x', '<leader>p', '"_dP', opts) -- paste without yanking
|
||||
map('v', '<', '<gv', opts) -- reselect after indent
|
||||
map('v', '>', '>gv', opts)
|
||||
map('v', 'J', ":m '>+1<CR>gv=gv", opts) -- move lines
|
||||
map('v', 'K', ":m '<-2<CR>gv=gv", opts)
|
||||
|
||||
-- Buffer navigation
|
||||
map('n', '<C-J>', ':bnext<CR>', opts)
|
||||
map('n', '<C-K>', ':bprev<CR>', opts)
|
||||
map('n', '<leader>bb', ':Telescope buffers<CR>', opts)
|
||||
map('n', '<leader>bk', ':bdelete<CR>', opts)
|
||||
map('n', '<leader>bn', ':bnext<CR>', opts)
|
||||
map('n', '<leader>bp', ':bprev<CR>', opts)
|
||||
|
||||
-- Terminal mappings
|
||||
map('n', '<C-T>', ':wa<CR>:FloatermToggle floatterm<CR>', opts)
|
||||
map('t', '<C-T>', '<C-\\><C-n>:FloatermToggle floatterm<CR>', opts)
|
||||
map('t', '<Esc>', '<C-\\><C-n>', opts)
|
||||
map('n', '<leader>tt', ':FloatermToggle split-term<CR>', opts)
|
||||
map('t', '<leader>tt', '<C-\\><C-N>:FloatermToggle split-term<CR>', opts)
|
||||
map('t', '<leader>tf', '<C-\\><C-N>:FloatermToggle floatterm<CR>', opts)
|
||||
map('t', '<leader>tp', '<C-\\><C-N>:FloatermToggle ipython<CR>', opts)
|
||||
map('t', '<leader>tP', '<C-\\><C-N>:FloatermToggle ipython-full<CR>', opts)
|
||||
map('t', '<space>', '<space>', opts) -- fix space in terminal
|
||||
|
||||
-- LSP mappings
|
||||
map('n', 'gA', vim.lsp.buf.code_action, opts)
|
||||
map('n', 'gd', ':Telescope lsp_definitions<CR>', opts)
|
||||
map('n', 'gDc', ':Telescope lsp_implementations<CR>', opts)
|
||||
map('n', 'gDf', ':Telescope lsp_definitions<CR>', opts)
|
||||
map('n', 'gF', ':edit <cfile><CR>', opts)
|
||||
map('n', 'gT', ':Telescope lsp_type_definitions<CR>', opts)
|
||||
map('n', 'gb', ':Gitsigns blame_line<CR>', opts)
|
||||
map('n', 'gi', ':Telescope lsp_implementations<CR>', opts)
|
||||
map('n', 'gj', ':Telescope jumplist<CR>', opts)
|
||||
map('n', 'gl', vim.lsp.codelens.run, opts)
|
||||
map('n', 'gr', ':Telescope lsp_references<CR>', opts)
|
||||
map('n', 'gs', vim.lsp.buf.signature_help, opts)
|
||||
map('n', 'K', vim.lsp.buf.hover, opts)
|
||||
|
||||
-- Code Companion and Copilot
|
||||
map('n', '<leader>cc', ':CodeCompanionChat<CR>', opts)
|
||||
map('n', '<leader>ci', ':CodeCompanion ', opts)
|
||||
map('n', '<leader>cp', ':vert Copilot panel<CR>', opts)
|
||||
map('n', '<leader>Ca', ':CodeCompanionActions<CR>', opts)
|
||||
map('v', '<leader>Cc', ':CodeCompanionChat Add<CR>', opts)
|
||||
map('v', '<leader>Ce', ':CodeCompanion /explain<CR>', opts)
|
||||
map('v', '<leader>Cf', ':CodeCompanion /fix<CR>', opts)
|
||||
map('v', '<leader>Cl', ':CodeCompanion /lsp<CR>', opts)
|
||||
map('v', '<leader>CT', ':CodeCompanion /tests<CR>', opts)
|
||||
|
||||
-- Telescope mappings
|
||||
map('n', '//', ':Telescope current_buffer_fuzzy_find<CR>', opts)
|
||||
map('n', '??', ':Telescope lsp_document_symbols<CR>', opts)
|
||||
map('n', '<leader>fc',
|
||||
':Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>',
|
||||
opts)
|
||||
map('n', '<leader>ff', ':Telescope find_files<CR>', opts)
|
||||
map('n', '<leader>sf', ':Telescope find_files<CR>', opts)
|
||||
map('n', '<leader>fg', ':Telescope live_grep<CR>', opts)
|
||||
map('n', '<leader>fG',
|
||||
':Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical<CR>',
|
||||
opts)
|
||||
map('n', '<leader>fb', ':Telescope file_browser<CR>', opts)
|
||||
map('n', '<leader>fr', ':Telescope oldfiles<CR>', opts)
|
||||
|
||||
-- File explorer and tools
|
||||
map('n', '<leader>n', ':NvimTreeToggle<CR>', opts)
|
||||
map('n', '<leader>D', ':Dotenv .env<CR>', opts)
|
||||
|
||||
-- Git mappings
|
||||
map('n', '<leader>gg', ':FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>', opts)
|
||||
map('n', '<leader>gc', ':Telescope git_commits<CR>', opts)
|
||||
map('n', '<leader>gf', ':Telescope git_files<CR>', opts)
|
||||
|
||||
-- Misc utilities
|
||||
map('n', '<leader>x', '<cmd>!chmod +x %<CR>', opts)
|
||||
map('n', '<leader>y', '"+', opts)
|
||||
map('v', '<leader>y', '"+', opts)
|
||||
|
||||
-- Terminal applications
|
||||
map('n', '<leader>oB', ':FloatermNew --title=btop --opener=vsplit btop<CR>', opts)
|
||||
map('n', '<leader>od', ':FloatermNew --title=lazydocker --opener=vsplit --width=0.75 --height=0.75 lazydocker<CR>', opts)
|
||||
map('n', '<leader>on', ':FloatermNew --title=ncmpcpp --opener=vsplit ncmpcpp --width=1 --height=1<CR>', opts)
|
||||
map('n', '<leader>or', ':FloatermNew --title=ranger --opener=vsplit --width=1.0 --height=1.0 ranger --cmd="cd $PWD"<CR>',
|
||||
opts)
|
||||
|
||||
map('n', "gpc", ':lua require("goto-preview").close_all_win()<CR>')
|
||||
map('n', "gpd", ':lua require("goto-preview").goto_preview_definition()<CR>')
|
||||
map('n', "gpi", ':lua require("goto-preview").goto_preview_implementation()<CR>')
|
||||
|
||||
-- Workspace management
|
||||
map('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
map('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
map('n', '<leader>wl', function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, opts)
|
||||
|
||||
-- Helper
|
||||
map('n', '<leader>hc', ':Telescope commands<CR>')
|
||||
map('n', '<leader>hv', ':Telescope vim_options<CR>')
|
||||
map('n', '<leader>hk', ':Telescope keymaps<CR>')
|
||||
map('n', '<leader>hs', ':Telescope spell_suggest<CR>')
|
||||
map('n', '<leader>hm', ':Telescope man_pages<CR>')
|
||||
|
||||
-- LSP
|
||||
map('n', '<leader>ld', ':Telescope lsp_definitions<CR>')
|
||||
map('n', '<leader>lD', ':Telescope diagnostic<CR>')
|
||||
map('n', '<leader>la', ':lua vim.lsp.buf.code_action()<CR>')
|
||||
map('n', '<leader>lci', ':Telescope lsp_incoming_calls<CR>')
|
||||
map('n', '<leader>lco', ':Telescope lsp_outgoing_calls<CR>')
|
||||
map('n', '<leader>lh', ':lua vim.lsp.buf.signature_help()<CR>')
|
||||
map('n', '<leader>li', ':Telescope lsp_implementations<CR>')
|
||||
map('n', '<leader>lr', ':Telescope lsp_references<CR>')
|
||||
map('n', '<leader>lR', ':lua vim.lsp.buf.rename()<CR>')
|
||||
map('n', '<leader>ls', ':Telescope lsp_document_symbols<CR>')
|
||||
map('n', '<leader>lt', ':Telescope lsp_type_definitions<CR>')
|
||||
map('n', '<leader>lw', ':Telescope lsp_dynamic_workspace_symbols<CR>')
|
||||
|
||||
|
||||
map('n', '<leader>ob', ':Telescope file_browser<CR>')
|
||||
map('n', '<leader>ot',
|
||||
':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR>')
|
||||
map('n', '<leader>oh',
|
||||
':FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=split --position=botright --height=0.45<CR>')
|
||||
map('n', '<leader>op',
|
||||
':FloatermNew --title=ipython --name=ipython --opener=split --wintype=vsplit --position=botright --width=0.5 ipython<CR>')
|
||||
map('n', '<leader>oP',
|
||||
':FloatermNew --title=ipython-full --name=ipython-full --opener=edit --width=1.0 --height=1.0 ipython<CR>')
|
||||
|
||||
map('n', '<leader>oc', ':CodeCompanionChat<CR>')
|
||||
map('n', '<leader>of', ':FloatermToggle floatterm<CR>')
|
||||
|
||||
map('n', '<leader>sc', ':nohls<CR>')
|
||||
map('n', '<leader>sf', ':Telescope find_files<CR>')
|
||||
map('n', '<leader>sg', ':Telescope live_grep<CR>')
|
||||
map('n', '<leader>sh', ':Telescope command_history<CR>')
|
||||
map('n', '<leader>sm', ':Telescope man_pages<CR>')
|
||||
map('n', '<leader>s/', ':Telescope search_history<CR>')
|
||||
map('n', '<leader>sc', ':nohls<CR>')
|
||||
@@ -27,69 +27,7 @@ require('packer').startup(function(use)
|
||||
-- }}}
|
||||
|
||||
-- LSP/DEV {{{
|
||||
|
||||
-- COPILOT {{{
|
||||
use {
|
||||
"zbirenbaum/copilot.lua",
|
||||
event = "VimEnter",
|
||||
config = function()
|
||||
require('copilot').setup({
|
||||
panel = {
|
||||
enabled = false,
|
||||
auto_refresh = false,
|
||||
keymap = {
|
||||
jump_prev = "[[",
|
||||
jump_next = "]]",
|
||||
accept = "<CR>",
|
||||
refresh = "gr",
|
||||
open = "<C-CR>"
|
||||
},
|
||||
layout = {
|
||||
position = "right", -- | top | left | right
|
||||
ratio = 0.4
|
||||
}
|
||||
},
|
||||
suggestion = {
|
||||
enabled = false,
|
||||
auto_trigger = false,
|
||||
debounce = 75,
|
||||
keymap = {
|
||||
accept = "<C-l>",
|
||||
-- accept = "<Right>",
|
||||
next = "<M-]>",
|
||||
prev = "<M-[>",
|
||||
dismiss = "<C-]>"
|
||||
}
|
||||
},
|
||||
-- filetypes = {
|
||||
-- yaml = false,
|
||||
-- markdown = false,
|
||||
-- help = false,
|
||||
-- gitcommit = false,
|
||||
-- gitrebase = false,
|
||||
-- hgcommit = false,
|
||||
-- svn = false,
|
||||
-- cvs = false,
|
||||
-- ["."] = false,
|
||||
-- },
|
||||
copilot_node_command = 'node', -- Node version must be < 18
|
||||
plugin_manager_path = vim.fn.stdpath("data") ..
|
||||
"/site/pack/packer",
|
||||
server_opts_overrides = {
|
||||
trace = "verbose",
|
||||
settings = {
|
||||
advanced = {
|
||||
listCount = 10, -- #completions for panel
|
||||
inlineSuggestCount = 4 -- #completions for getCompletions
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use { "zbirenbaum/copilot-cmp" }
|
||||
-- }}}
|
||||
|
||||
use({
|
||||
"olimorris/codecompanion.nvim",
|
||||
@@ -131,15 +69,11 @@ require('packer').startup(function(use)
|
||||
use { 'lukas-reineke/lsp-format.nvim' }
|
||||
use 'mfussenegger/nvim-lint'
|
||||
|
||||
-- DAP {{{
|
||||
|
||||
use 'mfussenegger/nvim-dap'
|
||||
use 'nvim-neotest/nvim-nio'
|
||||
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
use { 'mfussenegger/nvim-dap-python' }
|
||||
use { 'theHamsta/nvim-dap-virtual-text' }
|
||||
|
||||
-- }}}
|
||||
-- use 'mfussenegger/nvim-dap'
|
||||
-- use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
-- use { 'mfussenegger/nvim-dap-python' }
|
||||
-- use { 'theHamsta/nvim-dap-virtual-text' }
|
||||
|
||||
-- DADBOD {{{
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
local function map(m, k, v)
|
||||
vim.keymap.set(m, k, v, { silent = true, noremap = true })
|
||||
end
|
||||
15
lua/plugins/ai/codecompanion.lua
Normal file
15
lua/plugins/ai/codecompanion.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
require("codecompanion").setup({
|
||||
strategies = {
|
||||
chat = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
inline = {
|
||||
adapter = "copilot",
|
||||
},
|
||||
},
|
||||
display = {
|
||||
action_palette = {
|
||||
provider = "telescope"
|
||||
}
|
||||
}
|
||||
})
|
||||
1
lua/plugins/ai/init.lua
Normal file
1
lua/plugins/ai/init.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("plugins.ai.codecompanion")
|
||||
68
lua/plugins/colorscheme/catppuccin.lua
Normal file
68
lua/plugins/colorscheme/catppuccin.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
require("catppuccin").setup({
|
||||
flavour = "macchiato", -- latte, frappe, macchiato, mocha
|
||||
background = { -- :h background
|
||||
light = "latte",
|
||||
-- dark = "mocha",
|
||||
dark = "macchiato",
|
||||
},
|
||||
transparent_background = false,
|
||||
show_end_of_buffer = false, -- show the '~' characters after the end of buffers
|
||||
term_colors = false,
|
||||
dim_inactive = {
|
||||
enabled = false,
|
||||
shade = "dark",
|
||||
percentage = 0.15,
|
||||
},
|
||||
no_italic = false, -- Force no italic
|
||||
no_bold = false, -- Force no bold
|
||||
styles = {
|
||||
comments = { "italic" },
|
||||
conditionals = { "italic" },
|
||||
loops = { "bold" },
|
||||
functions = { "bold", "italic" },
|
||||
keywords = { "bold" },
|
||||
strings = { "italic" },
|
||||
variables = { "italic" },
|
||||
numbers = {},
|
||||
booleans = {},
|
||||
properties = {},
|
||||
types = { "bold" },
|
||||
operators = {},
|
||||
},
|
||||
color_overrides = {},
|
||||
custom_highlights = {},
|
||||
integrations = {
|
||||
cmp = true,
|
||||
gitsigns = true,
|
||||
treesitter = true,
|
||||
nvimtree = true,
|
||||
telescope = true,
|
||||
which_key = true,
|
||||
notify = false,
|
||||
mini = false
|
||||
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
|
||||
},
|
||||
native_lsp = {
|
||||
enabled = true,
|
||||
virtual_text = {
|
||||
errors = { "italic" },
|
||||
hints = { "italic" },
|
||||
warnings = { "italic" },
|
||||
information = { "italic" },
|
||||
},
|
||||
underlines = {
|
||||
errors = { "underline" },
|
||||
hints = { "underline" },
|
||||
warnings = { "underline" },
|
||||
information = { "underline" },
|
||||
},
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
require("nvim-treesitter.configs").setup {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false
|
||||
},
|
||||
}
|
||||
33
lua/plugins/colorscheme/dracula.lua
Normal file
33
lua/plugins/colorscheme/dracula.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
-- customize dracula color palette
|
||||
vim.g.dracula_colors = {
|
||||
bg = "#282A36",
|
||||
fg = "#F8F8F2",
|
||||
selection = "#44475A",
|
||||
comment = "#6272A4",
|
||||
red = "#FF5555",
|
||||
orange = "#FFB86C",
|
||||
yellow = "#F1FA8C",
|
||||
green = "#50fa7b",
|
||||
purple = "#BD93F9",
|
||||
cyan = "#8BE9FD",
|
||||
pink = "#FF79C6",
|
||||
bright_red = "#FF6E6E",
|
||||
bright_green = "#69FF94",
|
||||
bright_yellow = "#FFFFA5",
|
||||
bright_blue = "#D6ACFF",
|
||||
bright_magenta = "#FF92DF",
|
||||
bright_cyan = "#A4FFFF",
|
||||
bright_white = "#FFFFFF",
|
||||
menu = "#21222C",
|
||||
visual = "#3E4452",
|
||||
gutter_fg = "#4B5263",
|
||||
nontext = "#3B4048",
|
||||
}
|
||||
-- show the '~' characters after the end of buffers
|
||||
vim.g.dracula_show_end_of_buffer = true
|
||||
-- use transparent background
|
||||
vim.g.dracula_transparent_bg = true
|
||||
-- set custom lualine background color
|
||||
vim.g.dracula_lualine_bg_color = "#44475a"
|
||||
-- set italic comment
|
||||
vim.g.dracula_italic_comment = true
|
||||
3
lua/plugins/colorscheme/init.lua
Normal file
3
lua/plugins/colorscheme/init.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
require("plugins.colorscheme.catppuccin")
|
||||
require("plugins.colorscheme.dracula")
|
||||
require("plugins.colorscheme.onedarkpro")
|
||||
74
lua/plugins/colorscheme/onedarkpro.lua
Normal file
74
lua/plugins/colorscheme/onedarkpro.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
require("onedarkpro").setup({
|
||||
colors = {}, -- Override default colors or create your own
|
||||
filetypes = { -- Override which filetype highlight groups are loaded
|
||||
java = true,
|
||||
javascript = true,
|
||||
lua = true,
|
||||
markdown = true,
|
||||
php = true,
|
||||
python = true,
|
||||
ruby = true,
|
||||
rust = true,
|
||||
toml = true,
|
||||
typescript = true,
|
||||
typescriptreact = true,
|
||||
vue = true,
|
||||
yaml = true,
|
||||
},
|
||||
plugins = { -- Override which plugin highlight groups are loaded
|
||||
aerial = false,
|
||||
barbar = false,
|
||||
copilot = true,
|
||||
dashboard = true,
|
||||
gitsigns = true,
|
||||
hop = false,
|
||||
indentline = false,
|
||||
leap = false,
|
||||
lsp_saga = false,
|
||||
marks = true,
|
||||
neotest = false,
|
||||
neo_tree = true,
|
||||
nvim_cmp = true,
|
||||
nvim_bqf = false,
|
||||
nvim_dap = true,
|
||||
nvim_dap_ui = true,
|
||||
nvim_hlslens = true,
|
||||
nvim_lsp = true,
|
||||
nvim_navic = false,
|
||||
nvim_notify = true,
|
||||
nvim_tree = true,
|
||||
nvim_ts_rainbow = true,
|
||||
op_nvim = false,
|
||||
packer = true,
|
||||
polygot = true,
|
||||
startify = false,
|
||||
telescope = true,
|
||||
toggleterm = true,
|
||||
treesitter = true,
|
||||
trouble = true,
|
||||
vim_ultest = false,
|
||||
which_key = true,
|
||||
},
|
||||
highlights = {}, -- Override default highlight groups or create your own
|
||||
styles = { -- For example, to apply bold and italic, use "bold,italic"
|
||||
types = "bold", -- Style that is applied to types
|
||||
methods = "NONE", -- Style that is applied to methods
|
||||
numbers = "NONE", -- Style that is applied to numbers
|
||||
strings = "italic", -- Style that is applied to strings
|
||||
comments = "italic", -- Style that is applied to comments
|
||||
keywords = "bold,italic", -- Style that is applied to keywords
|
||||
constants = "bold", -- Style that is applied to constants
|
||||
functions = "bold,italic", -- Style that is applied to functions
|
||||
operators = "NONE", -- Style that is applied to operators
|
||||
variables = "italic", -- Style that is applied to variables
|
||||
parameters = "italic", -- Style that is applied to parameters
|
||||
conditionals = "NONE", -- Style that is applied to conditionals
|
||||
virtual_text = "italic", -- Style that is applied to virtual text
|
||||
},
|
||||
options = {
|
||||
cursorline = true, -- Use cursorline highlighting?
|
||||
transparency = false, -- Use a transparent background?
|
||||
terminal_colors = true, -- Use the theme's colors for Neovim's :terminal?
|
||||
highlight_inactive_windows = false, -- When the window is out of focus, change the normal background?
|
||||
}
|
||||
})
|
||||
8
lua/plugins/lsp/copilot-cmp.lua
Normal file
8
lua/plugins/lsp/copilot-cmp.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
require("copilot_cmp").setup({
|
||||
suggestion = { enabled = false },
|
||||
panel = { enabled = false }
|
||||
-- method = "getCompletionsCycling",
|
||||
-- formatters = {
|
||||
-- insert_text = require("copilot_cmp.format").remove_existing
|
||||
-- }
|
||||
})
|
||||
10
lua/plugins/lsp/init.lua
Normal file
10
lua/plugins/lsp/init.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
require('plugins.lsp.copilot-cmp')
|
||||
require('plugins.lsp.lsp-format')
|
||||
require('plugins.lsp.lsp-kind')
|
||||
require('plugins.lsp.lspconfig')
|
||||
-- require('plugins.lsp.lspfuzzy')
|
||||
require('plugins.lsp.lsplines')
|
||||
require('plugins.lsp.luasnip')
|
||||
require('plugins.lsp.null-ls')
|
||||
require('plugins.lsp.nvim-cmp')
|
||||
require('plugins.lsp.nvim-lint')
|
||||
1
lua/plugins/lsp/lsp-format.lua
Normal file
1
lua/plugins/lsp/lsp-format.lua
Normal file
@@ -0,0 +1 @@
|
||||
-- require("lsp-format").setup {}
|
||||
33
lua/plugins/lsp/lsp-kind.lua
Normal file
33
lua/plugins/lsp/lsp-kind.lua
Normal file
@@ -0,0 +1,33 @@
|
||||
-- lspkind.lua
|
||||
local lspkind = require("lspkind")
|
||||
lspkind.init({
|
||||
preset = 'default',
|
||||
symbol_map = {
|
||||
Copilot = "",
|
||||
Function = "",
|
||||
Text = "",
|
||||
Method = "",
|
||||
Operator = "",
|
||||
Keyword = "",
|
||||
Variable = "",
|
||||
Field = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
TypeParameter = "",
|
||||
},
|
||||
})
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", {fg ="#6CC644"})
|
||||
203
lua/plugins/lsp/lspconfig.lua
Normal file
203
lua/plugins/lsp/lspconfig.lua
Normal file
@@ -0,0 +1,203 @@
|
||||
-- local opts = { noremap = true, silent = true }
|
||||
-- vim.api.nvim_set_keymap('n', '<space>e',
|
||||
-- '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
-- vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>',
|
||||
-- opts)
|
||||
-- vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>',
|
||||
-- opts)
|
||||
-- vim.api.nvim_set_keymap('n', '<space>q',
|
||||
-- '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
local on_attach = function(client, bufnr)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
-- set in ~/.config/nvim/keybindings.vim
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-s>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
-- highlighting things under cursor
|
||||
-- if client.resolved_capabilities.document_highlight then
|
||||
-- vim.cmd [[
|
||||
-- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- augroup lsp_document_highlight
|
||||
-- autocmd! * <buffer>
|
||||
-- autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
-- autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
-- augroup END
|
||||
-- ]]
|
||||
-- end
|
||||
end
|
||||
|
||||
-- vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]
|
||||
-- vim.cmd [[autocmd! ColorScheme * highlight FloatBorder guifg=white guibg=#1f2335]]
|
||||
|
||||
-- squared corners
|
||||
|
||||
-- local border = {
|
||||
-- {"┌", "FloatBorder"},
|
||||
-- {"─", "FloatBorder"},
|
||||
-- {"┐", "FloatBorder"},
|
||||
-- {"|", "FloatBorder"},
|
||||
-- {"┘", "FloatBorder"},
|
||||
-- {"─", "FloatBorder"},
|
||||
-- {"└", "FloatBorder"},
|
||||
-- {"|", "FloatBorder"},
|
||||
-- }
|
||||
|
||||
-- rounded
|
||||
|
||||
local border = {
|
||||
{ "╭", "FloatBorder" }, { "─", "FloatBorder" }, { "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" }, { "╯", "FloatBorder" }, { "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" }, { "│", "FloatBorder" }
|
||||
}
|
||||
|
||||
local handlers = {
|
||||
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover,
|
||||
{ border = border }),
|
||||
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers
|
||||
.signature_help,
|
||||
{ border = border })
|
||||
}
|
||||
|
||||
-- local orig_util_open_floating_preview = vim.lsp.util.open_floating_preview
|
||||
-- function vim.lsp.util.open_floating_preview(contents, syntax, opts, ...)
|
||||
-- opts = {
|
||||
-- { "border", border },
|
||||
-- }
|
||||
-- opts.border = opts.border or border
|
||||
-- return orig_util_open_floating_preview(contents, syntax, opts, ...)
|
||||
-- end
|
||||
|
||||
local DEFAULT_SETTINGS = {
|
||||
ui = {
|
||||
icons = {
|
||||
-- The list icon to use for installed servers.
|
||||
server_installed = "◍",
|
||||
-- The list icon to use for servers that are pending installation.
|
||||
server_pending = "◍",
|
||||
-- The list icon to use for servers that are not installed.
|
||||
server_uninstalled = "◍"
|
||||
},
|
||||
keymaps = {
|
||||
-- Keymap to expand a server in the UI
|
||||
toggle_server_expand = "<CR>",
|
||||
-- Keymap to install a server
|
||||
install_server = "i",
|
||||
-- Keymap to reinstall/update a server
|
||||
update_server = "u",
|
||||
-- Keymap to update all installed servers
|
||||
update_all_servers = "U",
|
||||
-- Keymap to uninstall a server
|
||||
uninstall_server = "X"
|
||||
}
|
||||
},
|
||||
|
||||
-- The directory in which to install all servers.
|
||||
-- install_root_dir = "/home/sudacode/.vim/lsp",
|
||||
|
||||
pip = {
|
||||
-- These args will be added to `pip install` calls. Note that setting extra args might impact intended behavior
|
||||
-- and is not recommended.
|
||||
--
|
||||
-- Example: { "--proxy", "https://proxyserver" }
|
||||
install_args = {}
|
||||
},
|
||||
on_attach = on_attach,
|
||||
handlers = handlers,
|
||||
|
||||
-- Controls to which degree logs are written to the log file. It's useful to set this to vim.log.levels.DEBUG when
|
||||
-- debugging issues with server installations.
|
||||
log_level = vim.log.levels.INFO,
|
||||
|
||||
-- Limit for the maximum amount of servers to be installed at the same time. Once this limit is reached, any further
|
||||
-- servers that are requested to be installed will be put in a queue.
|
||||
max_concurrent_installers = 4
|
||||
}
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
signs = true,
|
||||
underline = false,
|
||||
update_in_insert = false,
|
||||
severity_sort = true
|
||||
})
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
|
||||
function PrintDiagnostics(opts, bufnr, line_nr, client_id)
|
||||
bufnr = bufnr or 0
|
||||
line_nr = line_nr or (vim.api.nvim_win_get_cursor(0)[1] - 1)
|
||||
opts = opts or { ['lnum'] = line_nr }
|
||||
|
||||
local line_diagnostics = vim.diagnostic.get(bufnr, opts)
|
||||
if vim.tbl_isempty(line_diagnostics) then return end
|
||||
|
||||
local diagnostic_message = ""
|
||||
for i, diagnostic in ipairs(line_diagnostics) do
|
||||
diagnostic_message = diagnostic_message ..
|
||||
string.format("%d: %s", i,
|
||||
diagnostic.message or "")
|
||||
print(diagnostic_message)
|
||||
if i ~= #line_diagnostics then
|
||||
diagnostic_message = diagnostic_message .. "\n"
|
||||
end
|
||||
end
|
||||
vim.api.nvim_echo({ { diagnostic_message, "Normal" } }, false, {})
|
||||
end
|
||||
|
||||
-- vim.cmd [[ autocmd! CursorHold * lua PrintDiagnostics() ]]
|
||||
|
||||
-- Register a handler that will be called for each installed server when it's ready (i.e. when installation is finished
|
||||
-- or if the server is already installed).
|
||||
|
||||
-- local servers = { 'jedi_language_server', 'bashls', 'vimls', 'yamlls', 'dockerls', 'rust_analyzer', 'clangd', 'ansiblels' }
|
||||
-- for _, lsp in pairs(servers) do
|
||||
-- require('lspconfig')[lsp].setup {
|
||||
-- on_attach = on_attach,
|
||||
-- handlers = handlers,
|
||||
-- flags = {
|
||||
-- -- This will be the default in neovim 0.7+
|
||||
-- debounce_text_changes = 150,
|
||||
-- }
|
||||
-- }
|
||||
-- end
|
||||
|
||||
-- local plugins_path = vim.fn.stdpath("data") .. "site/autoload/plug.vim"
|
||||
-- local dir_list = vim.fn.glob(plugins_path .. "/*", true, true)
|
||||
-- local library_table = {}
|
||||
-- for _, v in ipairs(dir_list) do
|
||||
-- library_table[v .. "/lua"] = true
|
||||
-- end
|
||||
-- library_table[vim.fn.expand("$VIMRUNTIME/lua")] = true
|
||||
-- library_table[vim.fn.stdpath("config") .. "/lua"] = true
|
||||
-- require('lspconfig').sumneko_lua.setup({
|
||||
-- settings = {
|
||||
-- Lua = {
|
||||
-- diagnostics = { globals = { "vim" } },
|
||||
-- workspace = { library = library_table },
|
||||
-- },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
-- -- require 'lspconfig'.bashls.setup {}
|
||||
16
lua/plugins/lsp/lspfuzzy.lua
Normal file
16
lua/plugins/lsp/lspfuzzy.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
require('lspfuzzy').setup {
|
||||
methods = 'all', -- either 'all' or a list of LSP methods (see below)
|
||||
jump_one = true, -- jump immediately if there is only one location
|
||||
save_last = false, -- save last location results for the :LspFuzzyLast command
|
||||
callback = nil, -- callback called after jumping to a location
|
||||
fzf_preview = { -- arguments to the FZF '--preview-window' option
|
||||
'right:+{2}-/2' -- preview on the right and centered on entry
|
||||
},
|
||||
fzf_action = { -- FZF actions
|
||||
['ctrl-t'] = 'tab split', -- go to location in a new tab
|
||||
['ctrl-v'] = 'vsplit', -- go to location in a vertical split
|
||||
['ctrl-x'] = 'split', -- go to location in a horizontal split
|
||||
},
|
||||
fzf_modifier = ':~:.', -- format FZF entries, see |filename-modifiers|
|
||||
fzf_trim = false, -- trim FZF entries
|
||||
}
|
||||
6
lua/plugins/lsp/lsplines.lua
Normal file
6
lua/plugins/lsp/lsplines.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
require("lsp_lines").setup()
|
||||
-- Disable virtual_text since it's redundant due to lsp_lines.
|
||||
vim.diagnostic.config({ virtual_text = false })
|
||||
|
||||
vim.keymap.set("", "<Leader>tl", require("lsp_lines").toggle,
|
||||
{ desc = "Toggle lsp_lines" })
|
||||
1
lua/plugins/lsp/luasnip.lua
Normal file
1
lua/plugins/lsp/luasnip.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
58
lua/plugins/lsp/null-ls.lua
Normal file
58
lua/plugins/lsp/null-ls.lua
Normal file
@@ -0,0 +1,58 @@
|
||||
local null_ls = require("null-ls")
|
||||
local helpers = require("null-ls.helpers")
|
||||
-- syncronous formatting
|
||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
||||
require("null-ls").setup({
|
||||
-- you can reuse a shared lspconfig on_attach callback here
|
||||
on_attach = function(client, bufnr)
|
||||
if client.supports_method("textDocument/formatting") then
|
||||
vim.api.nvim_clear_autocmds({ group = augroup, buffer = bufnr })
|
||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||
group = augroup,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
-- on 0.8, you should use vim.lsp.buf.format({ bufnr = bufnr }) instead
|
||||
-- on later neovim version, you should use vim.lsp.buf.format({ async = false }) instead
|
||||
-- vim.lsp.buf.formatting_sync()
|
||||
vim.lsp.buf.format({
|
||||
async = false,
|
||||
bufnr = bufnr,
|
||||
filter = function(client)
|
||||
return client.name == "null-ls"
|
||||
end
|
||||
})
|
||||
end,
|
||||
})
|
||||
end
|
||||
end,
|
||||
sources = {
|
||||
null_ls.builtins.completion.luasnip,
|
||||
null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.diagnostics.mypy,
|
||||
null_ls.builtins.diagnostics.markdownlint,
|
||||
null_ls.builtins.diagnostics.pylint,
|
||||
null_ls.builtins.diagnostics.pycodestyle,
|
||||
null_ls.builtins.formatting.stylua,
|
||||
null_ls.builtins.formatting.markdownlint,
|
||||
null_ls.builtins.formatting.prettier, -- handled by lsp server
|
||||
null_ls.builtins.formatting.shfmt.with({
|
||||
filetypes = { "sh", "bash" },
|
||||
extra_args = { "-i", "0", "-ci", "-sr" }
|
||||
}),
|
||||
-- null_ls.builtins.diagnostics.actionlint,
|
||||
}
|
||||
})
|
||||
|
||||
-- null_ls.setup({
|
||||
-- on_attach = function(client)
|
||||
-- if client.supports_method "textDocument/formatting" then
|
||||
-- vim.cmd([[
|
||||
-- augroup LspFormatting
|
||||
-- autocmd! * <buffer>
|
||||
-- autocmd BufWritePre <buffer> lua vim.lsp.buf.format()
|
||||
-- augroup END
|
||||
-- ]])
|
||||
-- end
|
||||
-- end,
|
||||
-- })
|
||||
275
lua/plugins/lsp/nvim-cmp.lua
Normal file
275
lua/plugins/lsp/nvim-cmp.lua
Normal file
@@ -0,0 +1,275 @@
|
||||
-- Setup nvim-cmp.
|
||||
local cmp = require 'cmp'
|
||||
local lspkind = require('lspkind')
|
||||
local lspconfig = require('lspconfig')
|
||||
-- luasnip setup
|
||||
local luasnip = require 'luasnip'
|
||||
local highlight = require('cmp.utils.highlight')
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
local has_words_before = function()
|
||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||
return false
|
||||
end
|
||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
||||
return col ~= 0 and
|
||||
vim.api.nvim_buf_get_text(0, line - 1, 0, line - 1, col, {})[1]:match(
|
||||
"^%s*$") == nil
|
||||
end
|
||||
|
||||
lspkind.init({ symbol_map = { Copilot = "" } })
|
||||
|
||||
vim.api.nvim_set_hl(0, "CmpItemKindCopilot", { fg = "#6CC644" })
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
|
||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
||||
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
|
||||
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end
|
||||
},
|
||||
capabilities = capabilities,
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_prev_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<C-n>'] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
elseif has_words_before() then
|
||||
cmp.complete()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's' }),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm {
|
||||
behavior = cmp.ConfirmBehavior.Replace,
|
||||
select = false
|
||||
},
|
||||
-- ["<Tab>"] = cmp.mapping(function(fallback)
|
||||
-- if cmp.visible() then
|
||||
-- cmp.select_next_item()
|
||||
-- elseif luasnip.expand_or_jumpable() then
|
||||
-- luasnip.expand_or_jump()
|
||||
-- else
|
||||
-- fallback()
|
||||
-- end
|
||||
-- end, { "i", "s" }),
|
||||
["<Tab>"] = vim.schedule_wrap(function(fallback)
|
||||
if cmp.visible() and has_words_before() then
|
||||
cmp.select_next_item({ behavior = cmp.SelectBehavior.Select })
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end),
|
||||
['<S-Tab>'] = cmp.mapping(function()
|
||||
if cmp.visible() then cmp.select_prev_item() end
|
||||
end, { "i", "s" })
|
||||
},
|
||||
window = {
|
||||
completion = {
|
||||
winhighlight = "Normal:Pmenu,FloatBorder:Pmenu,Search:None",
|
||||
col_offset = -3,
|
||||
side_padding = 0,
|
||||
border = "rounded",
|
||||
borderchars = {
|
||||
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
||||
}
|
||||
},
|
||||
documentation = {
|
||||
border = "rounded",
|
||||
borderchars = {
|
||||
"─", "│", "─", "│", "╭", "╮", "╯", "╰"
|
||||
}
|
||||
-- padding = 15,
|
||||
}
|
||||
},
|
||||
formatting = {
|
||||
-- options: 'text', 'text_symbol', 'symbol_text', 'symbol'
|
||||
-- mode = 'symbol_text',
|
||||
fields = { "kind", "abbr", "menu" },
|
||||
format = function(entry, vim_item)
|
||||
local kind = require("lspkind").cmp_format({
|
||||
mode = "symbol_text",
|
||||
maxwidth = 75,
|
||||
symbol_map = {
|
||||
Copilot = "",
|
||||
Function = "",
|
||||
Text = "",
|
||||
Method = "",
|
||||
Operator = "",
|
||||
Keyword = "",
|
||||
Variable = "",
|
||||
Field = "",
|
||||
Class = "",
|
||||
Interface = "",
|
||||
Module = "",
|
||||
Property = "",
|
||||
Unit = "",
|
||||
Value = "",
|
||||
Enum = "",
|
||||
Snippet = "",
|
||||
Color = "",
|
||||
File = "",
|
||||
Reference = "",
|
||||
Folder = "",
|
||||
EnumMember = "",
|
||||
Constant = "",
|
||||
Struct = "",
|
||||
Event = "",
|
||||
TypeParameter = ""
|
||||
}
|
||||
})(entry, vim_item)
|
||||
local strings = vim.split(kind.kind, "%s", { trimempty = true })
|
||||
kind.kind = " " .. strings[1] .. " "
|
||||
kind.menu = " (" .. strings[2] .. ")"
|
||||
|
||||
return kind
|
||||
end
|
||||
-- format = lspkind.cmp_format({
|
||||
-- mode = 'symbol_text', -- show only symbol annotations
|
||||
-- menu = ({
|
||||
-- buffer = "[Buffer]",
|
||||
-- nvim_lsp = "[LSP]",
|
||||
-- luasnip = "[LuaSnip]",
|
||||
-- nvim_lua = "[Lua]",
|
||||
-- latex_symbols = "[Latex]",
|
||||
-- })
|
||||
-- })
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = "copilot", group_index = 2 },
|
||||
{ name = "codecompanion", group_index = 2 },
|
||||
{ name = "path", group_index = 2 },
|
||||
{ name = 'nvim_lsp', group_index = 2 },
|
||||
{ name = 'nvim_lsp_signature_help', group_index = 2 },
|
||||
{ name = 'nvim_lsp_document_symbol', group_index = 2 },
|
||||
{ name = 'vim-dadbod-completion', group_index = 2 },
|
||||
{ name = 'neorg', group_index = 2 }, -- For luasnip users.
|
||||
{ name = 'luasnip', group_index = 2 }, -- For luasnip users.
|
||||
{
|
||||
name = 'buffer',
|
||||
option = {
|
||||
get_bufnrs = function()
|
||||
local bufs = {}
|
||||
for _, win in ipairs(vim.api.nvim_list_wins()) do
|
||||
bufs[vim.api.nvim_win_get_buf(win)] = true
|
||||
end
|
||||
return vim.tbl_keys(bufs)
|
||||
end
|
||||
}
|
||||
}
|
||||
-- { name = 'ultisnips' }, -- For ultisnips users.
|
||||
-- { name = 'snippy' }, -- For snippy users.
|
||||
}, { { name = 'buffer' } }),
|
||||
sorting = {
|
||||
priority_weight = 2,
|
||||
comparators = {
|
||||
require("copilot_cmp.comparators").prioritize,
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
require("copilot_cmp.comparators").score,
|
||||
require("copilot_cmp.comparators").recently_used,
|
||||
cmp.config.compare.locality,
|
||||
require("copilot_cmp.comparators").kind,
|
||||
require("copilot_cmp.comparators").sort_text,
|
||||
require("copilot_cmp.comparators").length,
|
||||
require("copilot_cmp.comparators").order,
|
||||
|
||||
-- Below is the default comparitor list and order for nvim-cmp
|
||||
cmp.config.compare.offset,
|
||||
-- cmp.config.compare.scopes, --this is commented in nvim-cmp too
|
||||
cmp.config.compare.exact, cmp.config.compare.score,
|
||||
cmp.config.compare.recently_used, cmp.config.compare.locality,
|
||||
cmp.config.compare.kind, cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length, cmp.config.compare.order
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = { { name = 'buffer' } }
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({ { name = 'path' } }, {
|
||||
{ name = 'cmdline', option = { ignore_cmds = { 'Man', '!' } } }
|
||||
})
|
||||
})
|
||||
|
||||
local servers = {
|
||||
'bashls', 'jedi_language_server', 'jsonls', 'yamlls', 'vimls', 'dotls', 'dockerls',
|
||||
'html', 'cssls', 'lua_ls', 'eslint', 'ts_ls', 'angularls', 'ansiblels'
|
||||
}
|
||||
|
||||
for _, lsp in ipairs(servers) do
|
||||
if lsp == 'lua_ls' then
|
||||
require("lsp-format").setup {}
|
||||
lspconfig[lsp].setup {
|
||||
on_attach = require("lsp-format").on_attach,
|
||||
on_init = function(client)
|
||||
if client.workspace_folders then
|
||||
local path = client.workspace_folders[1].name
|
||||
if path ~= vim.fn.stdpath('config') and (vim.loop.fs_stat(path .. '/.luarc.json') or vim.loop.fs_stat(path .. '/.luarc.jsonc')) then
|
||||
return
|
||||
end
|
||||
end
|
||||
client.config.settings.Lua = vim.tbl_deep_extend('force', client.config.settings.Lua, {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using
|
||||
-- (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT'
|
||||
},
|
||||
-- Make the server aware of Neovim runtime files
|
||||
workspace = {
|
||||
checkThirdParty = false,
|
||||
library = {
|
||||
vim.env.VIMRUNTIME
|
||||
-- Depending on the usage, you might want to add additional paths here.
|
||||
-- "${3rd}/luv/library"
|
||||
-- "${3rd}/busted/library",
|
||||
}
|
||||
-- or pull in all of 'runtimepath'. NOTE: this is a lot slower and will cause issues when working on your own configuration (see https://github.com/neovim/nvim-lspconfig/issues/3189)
|
||||
-- library = vim.api.nvim_get_runtime_file("", true)
|
||||
}
|
||||
})
|
||||
end,
|
||||
capabilities = capabilities,
|
||||
callSnippet = "Replace",
|
||||
settings = {
|
||||
Lua = {}
|
||||
}
|
||||
}
|
||||
else
|
||||
lspconfig[lsp].setup {
|
||||
-- on_attach = require("lsp-format").on_attach,
|
||||
capabilities = capabilities
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
-- cmp.event:on("menu_opened",
|
||||
-- function() vim.b.copilot_suggestion_hidden = true end)
|
||||
-- cmp.event:on("menu_closed",
|
||||
-- function() vim.b.copilot_suggestion_hidden = false end)
|
||||
21
lua/plugins/lsp/nvim-lint.lua
Normal file
21
lua/plugins/lsp/nvim-lint.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
require('lint').linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
lua = { 'luacheck', 'luac' },
|
||||
vim = { 'vint' },
|
||||
sh = { 'shellcheck' },
|
||||
pyton = { 'pycodestyle', 'black', 'pydocstyle', 'pylint' },
|
||||
json = { 'jsonlint' },
|
||||
yaml = { 'yamllint' }
|
||||
}
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
-- try_lint without arguments runs the linters defined in `linters_by_ft`
|
||||
-- for the current filetype
|
||||
require("lint").try_lint()
|
||||
|
||||
-- You can call `try_lint` with a linter name or a list of names to always
|
||||
-- run specific linters, independent of the `linters_by_ft` configuration
|
||||
-- require("lint").try_lint("cspell")
|
||||
end,
|
||||
})
|
||||
85
lua/plugins/ui/bufferline.lua
Normal file
85
lua/plugins/ui/bufferline.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
require('bufferline').setup {
|
||||
options = {
|
||||
-- numbers = function(opts)
|
||||
-- return string.format("%s", opts.id)
|
||||
-- end,
|
||||
numbers = function(opts)
|
||||
return ""
|
||||
end,
|
||||
-- number_style = "superscript" | "subscript" | "" | { "none", "subscript" }, -- buffer_id at index 1, ordinal at index 2
|
||||
-- number_style = "none",
|
||||
close_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
right_mouse_command = "bdelete! %d", -- can be a string | function, see "Mouse actions"
|
||||
left_mouse_command = "buffer %d", -- can be a string | function, see "Mouse actions"
|
||||
middle_mouse_command = nil, -- can be a string | function, see "Mouse actions"
|
||||
-- NOTE: this plugin is designed with this icon in mind,
|
||||
-- and so changing this is NOT recommended, this is intended
|
||||
-- as an escape hatch for people who cannot bear it for whatever reason
|
||||
indicator_style = '▎',
|
||||
buffer_close_icon = '',
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
--- name_formatter can be used to change the buffer's label in the bufferline.
|
||||
--- Please note some names can/will break the
|
||||
--- bufferline so use this at your discretion knowing that it has
|
||||
--- some limitations that will *NOT* be fixed.
|
||||
name_formatter = function(buf) -- buf contains a "name", "path" and "bufnr"
|
||||
-- remove extension from markdown files for example
|
||||
if buf.name:match('%.md') then
|
||||
return vim.fn.fnamemodify(buf.name, ':t:r')
|
||||
end
|
||||
end,
|
||||
max_name_length = 18,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
tab_size = 18,
|
||||
-- diagnostics = false | "nvim_lsp" | "coc",
|
||||
diagnostics = "nvim_lsp",
|
||||
diagnostics_update_in_insert = false,
|
||||
diagnostics_indicator = function(count, level, diagnostics_dict, context)
|
||||
local s = " "
|
||||
for e, n in pairs(diagnostics_dict) do
|
||||
local sym = e == "error" and " "
|
||||
or e == "hint" and " "
|
||||
or (e == "warning" and " " or "" )
|
||||
s = s .. n .. sym
|
||||
end
|
||||
return s
|
||||
end,
|
||||
custom_filter = function(buf_number, buf_numbers)
|
||||
-- filter out filetypes you don't want to see
|
||||
if vim.bo[buf_number].filetype ~= "<i-dont-want-to-see-this>" then
|
||||
return true
|
||||
end
|
||||
-- filter out by buffer name
|
||||
if vim.fn.bufname(buf_number) ~= "<buffer-name-I-dont-want>" then
|
||||
return true
|
||||
end
|
||||
-- filter out based on arbitrary rules
|
||||
-- e.g. filter out vim wiki buffer from tabline in your work repo
|
||||
if vim.fn.getcwd() == "<work-repo>" and vim.bo[buf_number].filetype ~= "wiki" then
|
||||
return true
|
||||
end
|
||||
-- filter out by it's index number in list (don't show first buffer)
|
||||
if buf_numbers[1] ~= buf_number then
|
||||
return true
|
||||
end
|
||||
end,
|
||||
-- offsets = {{filetype = "NvimTree", text = "File Explorer" | function , text_align = "left" | "center" | "right"}},
|
||||
-- offsets = text_align = "left" | "center" | "right"}},
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = true,
|
||||
show_close_icon = false,
|
||||
show_tab_indicators = true,
|
||||
persist_buffer_sort = false, -- whether or not custom sorted buffers should persist
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
-- separator_style = "slant" | "thick" | "thin" | { 'any', 'any' },
|
||||
separator_style = "thick",
|
||||
enforce_regular_tabs = false,
|
||||
always_show_bufferline = true,
|
||||
-- sort_by = 'id' | 'extension' | 'relative_directory' | 'directory' | 'tabs' | function(buffer_a, buffer_b)
|
||||
sort_by = 'id',
|
||||
}
|
||||
}
|
||||
40
lua/plugins/ui/copilot-lualine.lua
Normal file
40
lua/plugins/ui/copilot-lualine.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
local lualine = require('lualine')
|
||||
lualine.setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = cozynight,
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = {
|
||||
'branch', 'diff', {
|
||||
'diagnostics',
|
||||
sources = { "nvim_diagnostic" },
|
||||
symbols = {
|
||||
error = ' ',
|
||||
warn = ' ',
|
||||
info = ' ',
|
||||
hint = ' '
|
||||
}
|
||||
}
|
||||
},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'copilot', 'encoding', 'fileformat', 'filetype' }, -- I added copilot here
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = { 'filename' },
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = {}
|
||||
})
|
||||
93
lua/plugins/ui/dashboard-nvim.lua
Normal file
93
lua/plugins/ui/dashboard-nvim.lua
Normal file
@@ -0,0 +1,93 @@
|
||||
local home = os.getenv('HOME')
|
||||
local db = require('dashboard')
|
||||
-- macos
|
||||
-- db.preview_command = 'cat | lolcat -F 0.3'
|
||||
-- linux
|
||||
-- db.preview_command = 'ueberzug'
|
||||
-- db.preview_file_path = home .. '/.config/nvim/static/neovim.cat'
|
||||
-- db.preview_file_height = 11
|
||||
-- db.preview_file_width = 70
|
||||
vim.cmd('source $HOME/.config/nvim/static/nvim-dashboard.vim')
|
||||
db.custom_center = {
|
||||
{
|
||||
icon = ' ',
|
||||
desc = 'Recently latest session ',
|
||||
shortcut = 'SPC s l',
|
||||
action = 'SessionLoad'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Recently opened files ',
|
||||
action = 'Telescope oldfiles',
|
||||
shortcut = 'SPC f h'
|
||||
}, {
|
||||
desc = 'Find File ',
|
||||
icon = ' ',
|
||||
action = 'Telescope find_files find_command=rg,--hidden,--files',
|
||||
shortcut = 'SPC f f'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'File Browser ',
|
||||
action = 'Telescope file_browser',
|
||||
shortcut = 'SPC f b'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Find word ',
|
||||
action = 'Telescope live_grep',
|
||||
shortcut = 'SPC f w'
|
||||
}, {
|
||||
icon = ' ',
|
||||
desc = 'Open Personal dotfiles ',
|
||||
action = ':e ~/.config/nvim/init.vim',
|
||||
shortcut = 'SPC f d'
|
||||
}
|
||||
}
|
||||
require('dashboard').setup {
|
||||
theme = 'doom', -- theme is doom and hyper default is hyper
|
||||
disable_move = false, -- default is false disable move keymap for hyper
|
||||
shortcut_type = 'number', -- shorcut type 'letter' or 'number'
|
||||
change_to_vcs_root = false, -- default is false,for open file in hyper mru. it will change to the root of vcs
|
||||
config = {
|
||||
header = { "NVIM DASHBOARD" }, -- your header
|
||||
center = {
|
||||
{
|
||||
icon = ' ',
|
||||
icon_hl = 'Title',
|
||||
desc = 'Open Recent',
|
||||
desc_hl = 'String',
|
||||
key = '1',
|
||||
keymap = 'SPC f r',
|
||||
key_hl = 'Number',
|
||||
action = 'lua print(1)'
|
||||
}, {
|
||||
icon = ' ',
|
||||
icon_hl = 'Title',
|
||||
desc = 'Find File',
|
||||
desc_hl = 'String',
|
||||
key = '2',
|
||||
key_hl = 'Number',
|
||||
keymap = 'SPC f f',
|
||||
action = 'lua print(2)'
|
||||
}
|
||||
|
||||
-- {
|
||||
-- icon = ' ',
|
||||
-- desc = 'Find Dotfiles',
|
||||
-- key = 'f',
|
||||
-- keymap = 'SPC f d',
|
||||
-- action = 'lua print(3)'
|
||||
-- }
|
||||
},
|
||||
footer = {} -- your footer
|
||||
},
|
||||
hide = {
|
||||
statusline = true, -- hide statusline default is true
|
||||
tabline = true, -- hide the tabline
|
||||
winbar = true -- hide winbar
|
||||
}
|
||||
-- preview = {
|
||||
-- command = "bat", -- preview command
|
||||
-- file_path -- preview file path
|
||||
-- file_height -- preview file height
|
||||
-- file_width -- preview file width
|
||||
-- },
|
||||
}
|
||||
49
lua/plugins/ui/fidget.lua
Normal file
49
lua/plugins/ui/fidget.lua
Normal file
@@ -0,0 +1,49 @@
|
||||
require"fidget".setup {
|
||||
text = {
|
||||
spinner = "pipe", -- animation shown when tasks are ongoing
|
||||
done = "✔", -- character shown when all tasks are complete
|
||||
commenced = "Started", -- message shown when task starts
|
||||
completed = "Completed", -- message shown when task completes
|
||||
},
|
||||
align = {
|
||||
bottom = true, -- align fidgets along bottom edge of buffer
|
||||
right = true, -- align fidgets along right edge of buffer
|
||||
},
|
||||
timer = {
|
||||
spinner_rate = 125, -- frame rate of spinner animation, in ms
|
||||
fidget_decay = 2000, -- how long to keep around empty fidget, in ms
|
||||
task_decay = 1000, -- how long to keep around completed task, in ms
|
||||
},
|
||||
window = {
|
||||
relative = "win", -- where to anchor, either "win" or "editor"
|
||||
blend = 100, -- &winblend for the window
|
||||
zindex = nil, -- the zindex value for the window
|
||||
},
|
||||
fmt = {
|
||||
leftpad = true, -- right-justify text in fidget box
|
||||
stack_upwards = true, -- list of tasks grows upwards
|
||||
max_width = 0, -- maximum width of the fidget box
|
||||
fidget = -- function to format fidget title
|
||||
function(fidget_name, spinner)
|
||||
return string.format("%s %s", spinner, fidget_name)
|
||||
end,
|
||||
task = -- function to format each task line
|
||||
function(task_name, message, percentage)
|
||||
return string.format(
|
||||
"%s%s [%s]",
|
||||
message,
|
||||
percentage and string.format(" (%s%%)", percentage) or "",
|
||||
task_name
|
||||
)
|
||||
end,
|
||||
},
|
||||
-- sources = {
|
||||
-- * = {
|
||||
-- ignore = false,
|
||||
-- },
|
||||
-- },
|
||||
-- debug = {
|
||||
-- logging = false, -- whether to enable logging, for debugging
|
||||
-- strict = false, -- whether to interpret LSP strictly
|
||||
-- },
|
||||
}
|
||||
2
lua/plugins/ui/git-blame.lua
Normal file
2
lua/plugins/ui/git-blame.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.g.gitblame_highlight_group = "Question"
|
||||
vim.g.gitblame_enabled = 0
|
||||
48
lua/plugins/ui/gitsigns.lua
Normal file
48
lua/plugins/ui/gitsigns.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' }
|
||||
},
|
||||
signs_staged = {
|
||||
add = { text = '┃' },
|
||||
change = { text = '┃' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' }
|
||||
},
|
||||
signs_staged_enable = true,
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = { follow_files = true },
|
||||
auto_attach = true,
|
||||
attach_to_untracked = false,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
virt_text_priority = 100
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%R> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
}
|
||||
}
|
||||
|
||||
17
lua/plugins/ui/init.lua
Normal file
17
lua/plugins/ui/init.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
require('plugins.ui.bufferline')
|
||||
require('plugins.ui.copilot-lualine')
|
||||
require('plugins.ui.dashboard-nvim')
|
||||
require('plugins.ui.fidget')
|
||||
-- require('plugins.ui.git-blame')
|
||||
require('plugins.ui.gitsigns')
|
||||
require('plugins.ui.lualine')
|
||||
require('plugins.ui.nvim-colorizer')
|
||||
require('plugins.ui.nvim-notify')
|
||||
require('plugins.ui.nvimtree')
|
||||
require('plugins.ui.presence')
|
||||
require('plugins.ui.rainbow-delimiters')
|
||||
require('plugins.ui.telescope-file-browser')
|
||||
require('plugins.ui.telescope')
|
||||
require('plugins.ui.treesitter-context')
|
||||
require('plugins.ui.treesitter')
|
||||
require('plugins.ui.whichkey')
|
||||
103
lua/plugins/ui/lualine.lua
Normal file
103
lua/plugins/ui/lualine.lua
Normal file
@@ -0,0 +1,103 @@
|
||||
local M = require("lualine.component"):extend()
|
||||
|
||||
M.processing = false
|
||||
M.spinner_index = 1
|
||||
|
||||
local spinner_symbols = {
|
||||
"⠋",
|
||||
"⠙",
|
||||
"⠹",
|
||||
"⠸",
|
||||
"⠼",
|
||||
"⠴",
|
||||
"⠦",
|
||||
"⠧",
|
||||
"⠇",
|
||||
"⠏",
|
||||
}
|
||||
local spinner_symbols_len = 10
|
||||
|
||||
-- Initializer
|
||||
function M:init(options)
|
||||
M.super.init(self, options)
|
||||
|
||||
local group = vim.api.nvim_create_augroup("CodeCompanionHooks", {})
|
||||
|
||||
vim.api.nvim_create_autocmd({ "User" }, {
|
||||
pattern = "CodeCompanionRequest*",
|
||||
group = group,
|
||||
callback = function(request)
|
||||
if request.match == "CodeCompanionRequestStarted" then
|
||||
self.processing = true
|
||||
elseif request.match == "CodeCompanionRequestFinished" then
|
||||
self.processing = false
|
||||
end
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
-- Function that runs every time statusline is updated
|
||||
function M:update_status()
|
||||
if self.processing then
|
||||
self.spinner_index = (self.spinner_index % spinner_symbols_len) + 1
|
||||
return spinner_symbols[self.spinner_index]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'codedark',
|
||||
-- theme = 'dracula',
|
||||
-- theme = 'horizon',
|
||||
-- theme = 'onedark',
|
||||
component_separators = { left = '', right = '' },
|
||||
section_separators = { left = '', right = '' },
|
||||
disabled_filetypes = {},
|
||||
always_divide_middle = true,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { 'mode' },
|
||||
lualine_b = { 'branch', 'diff' },
|
||||
lualine_c = { 'filename', M },
|
||||
lualine_x = {
|
||||
{
|
||||
'diagnostics',
|
||||
'fileformat',
|
||||
symbols = {
|
||||
unix = '', -- e712
|
||||
dos = '', -- e70f
|
||||
mac = '', -- e711
|
||||
}
|
||||
}, 'encoding', 'fileformat', { 'filetype', colored = true, icon_only = false } },
|
||||
lualine_y = { 'progress' },
|
||||
lualine_z = { 'location' }
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
path = 0, -- 0: Just the filename
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
symbols = {
|
||||
modified = '[+]', -- Text to show when the file is modified.
|
||||
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = '[No Name]', -- Text to show for unnamed buffers.
|
||||
}
|
||||
},
|
||||
M
|
||||
},
|
||||
lualine_x = { 'location' },
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {},
|
||||
extensions = { 'quickfix', 'fzf', 'nvim-tree', 'symbols-outline', 'fugitive' }
|
||||
}
|
||||
|
||||
-- return M
|
||||
1
lua/plugins/ui/nvim-colorizer.lua
Normal file
1
lua/plugins/ui/nvim-colorizer.lua
Normal file
@@ -0,0 +1 @@
|
||||
require 'colorizer'.setup()
|
||||
17
lua/plugins/ui/nvim-notify.lua
Normal file
17
lua/plugins/ui/nvim-notify.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
require("notify").setup({
|
||||
background_colour = "#000000",
|
||||
fps = 144,
|
||||
icons = {
|
||||
DEBUG = "",
|
||||
ERROR = "",
|
||||
INFO = "",
|
||||
TRACE = "✎",
|
||||
WARN = ""
|
||||
},
|
||||
level = 2,
|
||||
minimum_width = 50,
|
||||
render = "default",
|
||||
stages = "fade_in_slide_out",
|
||||
timeout = 5000,
|
||||
top_down = true
|
||||
})
|
||||
67
lua/plugins/ui/nvimtree.lua
Normal file
67
lua/plugins/ui/nvimtree.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
require 'nvim-tree'.setup {
|
||||
disable_netrw = false,
|
||||
hijack_netrw = false,
|
||||
-- open_on_setup = false,
|
||||
-- ignore_ft_on_setup = {},
|
||||
-- auto_close = false,
|
||||
open_on_tab = false,
|
||||
hijack_cursor = false,
|
||||
update_cwd = false,
|
||||
-- update_to_buf_dir = {
|
||||
-- enable = true,
|
||||
-- auto_open = true,
|
||||
-- },
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = { hint = "", info = "", warning = "", error = "" }
|
||||
},
|
||||
update_focused_file = { enable = false, update_cwd = false, ignore_list = {} },
|
||||
system_open = { cmd = nil, args = {} },
|
||||
filters = { dotfiles = false, custom = {} },
|
||||
git = { enable = true, ignore = true, timeout = 500 },
|
||||
view = {
|
||||
width = 35,
|
||||
-- height = 35,
|
||||
-- hide_root_folder = false,
|
||||
side = 'left',
|
||||
-- auto_resize = false,
|
||||
-- mappings = {
|
||||
-- custom_only = false,
|
||||
-- list = {}
|
||||
-- },
|
||||
number = false,
|
||||
relativenumber = false,
|
||||
signcolumn = "yes"
|
||||
},
|
||||
trash = { cmd = "trash", require_confirm = true },
|
||||
actions = {
|
||||
change_dir = { global = false },
|
||||
open_file = { quit_on_open = false }
|
||||
}
|
||||
}
|
||||
|
||||
-- local tree_cb = require'nvim-tree.config'.nvim_tree_callback
|
||||
|
||||
-- default mappings
|
||||
local list = {
|
||||
{ key = { "<CR>", "o", "<2-LeftMouse>" }, action = "edit" },
|
||||
{ key = { "O" }, action = "edit_no_picker" },
|
||||
{ key = { "<2-RightMouse>", "<C-]>" }, action = "cd" },
|
||||
{ key = "<C-v>", action = "vsplit" }, { key = "<C-x>", action = "split" },
|
||||
{ key = "<C-t>", action = "tabnew" }, { key = "<", action = "prev_sibling" },
|
||||
{ key = ">", action = "next_sibling" }, { key = "P", action = "parent_node" },
|
||||
{ key = "<BS>", action = "close_node" }, { key = "<Tab>", action = "preview" },
|
||||
{ key = "K", action = "first_sibling" }, { key = "J", action = "last_sibling" },
|
||||
{ key = "I", action = "toggle_ignored" },
|
||||
{ key = "H", action = "toggle_dotfiles" }, { key = "R", action = "refresh" },
|
||||
{ key = "a", action = "create" }, { key = "d", action = "remove" },
|
||||
{ key = "D", action = "trash" }, { key = "r", action = "rename" },
|
||||
{ key = "<C-r>", action = "full_rename" }, { key = "x", action = "cut" },
|
||||
{ key = "c", action = "copy" }, { key = "p", action = "paste" },
|
||||
{ key = "y", action = "copy_name" }, { key = "Y", action = "copy_path" },
|
||||
{ key = "gy", action = "copy_absolute_path" },
|
||||
{ key = "[c", action = "prev_git_item" },
|
||||
{ key = "]c", action = "next_git_item" }, { key = "-", action = "dir_up" },
|
||||
{ key = "s", action = "system_open" }, { key = "q", action = "close" },
|
||||
{ key = "g?", action = "toggle_help" }
|
||||
}
|
||||
22
lua/plugins/ui/presence.lua
Normal file
22
lua/plugins/ui/presence.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
require("presence"):setup({
|
||||
-- General options
|
||||
auto_update = true, -- Update activity based on autocmd events (if `false`, map or manually execute `:lua package.loaded.presence:update()`)
|
||||
neovim_image_text = "The One True Text Editor", -- Text displayed when hovered over the Neovim image
|
||||
main_image = "neovim", -- Main image display (either "neovim" or "file")
|
||||
-- client_id = "793271441293967371", -- Use your own Discord application client id (not recommended)
|
||||
log_level = nil, -- Log messages at or above this level (one of the following: "debug", "info", "warn", "error")
|
||||
debounce_timeout = 10, -- Number of seconds to debounce events (or calls to `:lua package.loaded.presence:update(<filename>, true)`)
|
||||
enable_line_number = false, -- Displays the current line number instead of the current project
|
||||
blacklist = {}, -- A list of strings or Lua patterns that disable Rich Presence if the current file name, path, or workspace matches
|
||||
buttons = true, -- Configure Rich Presence button(s), either a boolean to enable/disable, a static table (`{{ label = "<label>", url = "<url>" }, ...}`, or a function(buffer: string, repo_url: string|nil): table)
|
||||
file_assets = {}, -- Custom file asset definitions keyed by file names and extensions (see default config at `lua/presence/file_assets.lua` for reference)
|
||||
|
||||
-- Rich Presence text options
|
||||
editing_text = "Editing %s", -- Format string rendered when an editable file is loaded in the buffer (either string or function(filename: string): string)
|
||||
file_explorer_text = "Browsing %s", -- Format string rendered when browsing a file explorer (either string or function(file_explorer_name: string): string)
|
||||
git_commit_text = "Committing changes", -- Format string rendered when committing changes in git (either string or function(filename: string): string)
|
||||
plugin_manager_text = "Managing plugins", -- Format string rendered when managing plugins (either string or function(plugin_manager_name: string): string)
|
||||
reading_text = "Reading %s", -- Format string rendered when a read-only or unmodifiable file is loaded in the buffer (either string or function(filename: string): string)
|
||||
workspace_text = "Working on %s", -- Format string rendered when in a git repository (either string or function(project_name: string|nil, filename: string): string)
|
||||
line_number_text = "Line %s out of %s", -- Format string rendered when `enable_line_number` is set to true (either string or function(line_number: number, line_count: number): string)
|
||||
})
|
||||
15
lua/plugins/ui/rainbow-delimiters.lua
Normal file
15
lua/plugins/ui/rainbow-delimiters.lua
Normal file
@@ -0,0 +1,15 @@
|
||||
-- This module contains a number of default definitions
|
||||
local rainbow_delimiters = require 'rainbow-delimiters'
|
||||
|
||||
vim.g.rainbow_delimiters = {
|
||||
strategy = {
|
||||
[''] = rainbow_delimiters.strategy['global'],
|
||||
vim = rainbow_delimiters.strategy['local']
|
||||
},
|
||||
query = { [''] = 'rainbow-delimiters', lua = 'rainbow-blocks' },
|
||||
highlight = {
|
||||
'RainbowDelimiterRed', 'RainbowDelimiterYellow', 'RainbowDelimiterBlue',
|
||||
'RainbowDelimiterOrange', 'RainbowDelimiterGreen',
|
||||
'RainbowDelimiterViolet', 'RainbowDelimiterCyan'
|
||||
}
|
||||
}
|
||||
25
lua/plugins/ui/telescope-file-browser.lua
Normal file
25
lua/plugins/ui/telescope-file-browser.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local fb_actions = require "telescope".extensions.file_browser.actions
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
file_browser = {
|
||||
-- theme = "ivy",
|
||||
-- disables netrw and use telescope-file-browser in its place
|
||||
hijack_netrw = true,
|
||||
mappings = {
|
||||
["i"] = {
|
||||
-- your custom insert mode mappings
|
||||
["<C-h>"] = fb_actions.goto_home_dir,
|
||||
["<C-x>"] = function(prompt_bufnr)
|
||||
end
|
||||
},
|
||||
["n"] = {
|
||||
-- your custom normal mode mappings
|
||||
f = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
-- To get telescope-file-browser loaded and working with telescope,
|
||||
-- you need to call load_extension, somewhere after setup function:
|
||||
require("telescope").load_extension "file_browser"
|
||||
67
lua/plugins/ui/telescope.lua
Normal file
67
lua/plugins/ui/telescope.lua
Normal file
@@ -0,0 +1,67 @@
|
||||
local ts = require('telescope')
|
||||
ts.setup({
|
||||
defaults = {
|
||||
-- Default configuration for telescope goes here:
|
||||
-- config_key = value,
|
||||
layout_strategy = 'flex',
|
||||
width = 0.9,
|
||||
wrap_results = true,
|
||||
preview = {
|
||||
border = true,
|
||||
borderchars = {
|
||||
'─', '│', '─', '│', '╭', '╮', '╯', '╰'
|
||||
},
|
||||
title = true,
|
||||
dynamic_preview_title = true,
|
||||
treesitter = true
|
||||
},
|
||||
mappings = {
|
||||
i = {
|
||||
-- map actions.which_key to <C-h> (default: <C-/>)
|
||||
-- actions.which_key shows the mappings for your picker,
|
||||
-- e.g. git_{create, delete, ...}_branch for the git_branches picker
|
||||
["<C-/>"] = "which_key"
|
||||
}
|
||||
},
|
||||
file_ignore_patterns = { "^node_modules/", "^env/", "^__pycache__/" }
|
||||
},
|
||||
pickers = {
|
||||
-- Default configuration for builtin pickers goes here:
|
||||
-- picker_name = {
|
||||
-- picker_config_key = value,
|
||||
-- ...
|
||||
-- }
|
||||
-- Now the picker_config_key will be applied every time you call this
|
||||
-- builtin picker
|
||||
find_files = {
|
||||
-- theme = "dropdown"
|
||||
}
|
||||
},
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case" -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
},
|
||||
glyph = {
|
||||
action = function(glyph)
|
||||
-- argument glyph is a table.
|
||||
-- {name="", value="", category="", description=""}
|
||||
|
||||
-- vim.fn.setreg("*", glyph.value)
|
||||
-- print([[Press p or "*p to paste this glyph]] .. glyph.value)
|
||||
|
||||
-- insert glyph when picked
|
||||
vim.api.nvim_put({ glyph.value }, 'c', false, true)
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
-- ts.load_extension('dap')
|
||||
ts.load_extension('fzf')
|
||||
ts.load_extension('glyph')
|
||||
ts.load_extension('color_names')
|
||||
ts.load_extension('notify')
|
||||
14
lua/plugins/ui/treesitter-context.lua
Normal file
14
lua/plugins/ui/treesitter-context.lua
Normal file
@@ -0,0 +1,14 @@
|
||||
require 'treesitter-context'.setup {
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||
line_numbers = true,
|
||||
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
||||
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
-- Separator between context and content. Should be a single character string, like '-'.
|
||||
-- When separator is set, the context will only show up when there are at least 2 lines above cursorline.
|
||||
separator = nil,
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
on_attach = nil -- (fun(buf: integer): boolean) return false to disable attaching
|
||||
}
|
||||
48
lua/plugins/ui/treesitter.lua
Normal file
48
lua/plugins/ui/treesitter.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
require 'nvim-treesitter.configs'.setup {
|
||||
-- A list of parser names, or "all" (the five listed parsers should always be installed)
|
||||
ensure_installed = {
|
||||
"c", "lua", "vim", "vimdoc", "query", "cpp", "python", "bash", "sql",
|
||||
"yaml", "toml", "dockerfile", "gitcommit", "gitignore", "html", "css",
|
||||
"javascript", "typescript", "rust", "go", "json", "regex", "latex",
|
||||
"comment", "cmake", "graphql", "haskell", "java", "php", "ruby",
|
||||
"sparql", "vue"
|
||||
},
|
||||
|
||||
-- Install parsers synchronously (only applied to `ensure_installed`)
|
||||
sync_install = false,
|
||||
|
||||
-- Automatically install missing parsers when entering buffer
|
||||
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
|
||||
auto_install = true,
|
||||
|
||||
-- List of parsers to ignore installing (for "all")
|
||||
-- ignore_install = { "javascript" },
|
||||
|
||||
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
|
||||
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
|
||||
|
||||
highlight = {
|
||||
enable = true,
|
||||
|
||||
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
|
||||
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
|
||||
-- the name of the parser)
|
||||
-- list of language that will be disabled
|
||||
-- disable = { "c", "rust" },
|
||||
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
|
||||
-- disable = function(lang, buf)
|
||||
-- local max_filesize = 100 * 1024 -- 100 KB
|
||||
-- local ok, stats = pcall(vim.loop.fs_stat,
|
||||
-- vim.api.nvim_buf_get_name(buf))
|
||||
-- if ok and stats and stats.size > max_filesize then
|
||||
-- return true
|
||||
-- end
|
||||
-- end,
|
||||
|
||||
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
|
||||
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
|
||||
-- Using this option may slow down your editor, and you may see some duplicate highlights.
|
||||
-- Instead of true it can also be a list of languages
|
||||
additional_vim_regex_highlighting = false
|
||||
}
|
||||
}
|
||||
96
lua/plugins/ui/whichkey.lua
Executable file
96
lua/plugins/ui/whichkey.lua
Executable file
@@ -0,0 +1,96 @@
|
||||
local wk = require("which-key")
|
||||
|
||||
wk.add({
|
||||
{ "<leader>C", group = "ChatGPT", desc = "ChatGPT", icon = "" },
|
||||
{ "<leader>Cd", desc = "Docstring" }, { "<leader>Ce", desc = "Explain Code" },
|
||||
{ "<leader>Cf", desc = "Fix Bugs" },
|
||||
{ "<leader>Ci", desc = "Edit with Instructions" },
|
||||
{ "<leader>Co", desc = "Optimize Code" }, { "<leader>Cs", desc = "Summarize" },
|
||||
{ "<leader>Ct", desc = "Add Tests" },
|
||||
{ "<leader>K", desc = "Show Docs", icon = "" },
|
||||
{ "<leader>T", group = "Telescope", icon = "" },
|
||||
{ "<leader>Tc", desc = "Color Names" }, { "<leader>Tg", desc = "Glyph" },
|
||||
{ "<leader>Tn", desc = "Notifications" }, { "<leader>Tt", desc = "Telescope" },
|
||||
{ "<leader>a", group = "AnyJump", icon = "" },
|
||||
{ "<leader>ab", desc = "Back" }, { "<leader>al", desc = "Last Result" },
|
||||
{ "<leader>b", group = "Buffers" }, { "<leader>bb", desc = "Show Buffers" },
|
||||
{ "<leader>bd", desc = "Delete Buffer" },
|
||||
{ "<leader>bn", desc = "Next Buffer" },
|
||||
{ "<leader>bp", desc = "Previous Buffer" },
|
||||
{ "<leader>c", group = "Code", icon = "" },
|
||||
{ "<leader>cD", group = "Diagnostic List" },
|
||||
{ "<leader>cDn", desc = "Next Diagnostic" },
|
||||
{ "<leader>cDp", desc = "Previous Diagnostic" },
|
||||
{ "<leader>ca", desc = "Code Action" }, { "<leader>cd", desc = "Diagnostics" },
|
||||
{ "<leader>cl", desc = "Set Loclist" },
|
||||
{ "<leader>cp", desc = "Copilot Panel" }, { "<leader>d", group = "Debug" },
|
||||
{ "<leader>dO", desc = "Step Out" }, { "<leader>dP", group = "Dap-python" },
|
||||
{ "<leader>dPc", desc = "Test Class" }, { "<leader>dPm", desc = "Test Method" },
|
||||
{ "<leader>dPs", desc = "Debug Selection" },
|
||||
{ "<leader>db", desc = "Toggle Breakpoint" },
|
||||
{ "<leader>dc", desc = "Continue" }, { "<leader>df", desc = "Frames" },
|
||||
{ "<leader>dh", desc = "Hover" }, { "<leader>di", desc = "Step Into" },
|
||||
{ "<leader>dl", desc = "Run Last" }, { "<leader>do", desc = "Step Over" },
|
||||
{ "<leader>dp", desc = "Preview" }, { "<leader>dr", desc = "REPL Open" },
|
||||
{ "<leader>ds", desc = "Scopes" }, { "<leader>du", group = "Dap UI" },
|
||||
{ "<leader>duc", desc = "Close" }, { "<leader>duo", desc = "Open" },
|
||||
{ "<leader>dut", desc = "Toggle" }, { "<leader>f", group = "Find File" },
|
||||
{ "<leader>fb", desc = "File Browser" }, { "<leader>fc", desc = "File Color" },
|
||||
{ "<leader>ff", desc = "Find in Current Directory" },
|
||||
{ "<leader>fg", desc = "Live Grep" }, { "<leader>fr", desc = "File Recent" },
|
||||
{ "<leader>g", group = "Git" },
|
||||
{ "<leader>gP", desc = "Close goto-preview window" },
|
||||
{ "<leader>gR", desc = "Telescope References" },
|
||||
{ "<leader>gb", desc = "Blame" }, { "<leader>gc", desc = "Commit" },
|
||||
{ "<leader>gf", desc = "Files" }, { "<leader>gg", desc = "Lazygit" },
|
||||
{ "<leader>gp", desc = "Peek" }, { "<leader>gpc", desc = "Close Preview" },
|
||||
{ "<leader>gpd", desc = "Preview Definition" },
|
||||
{ "<leader>gpi", desc = "Preview Implementation" },
|
||||
{ "<leader>h", group = "Help", icon = "" },
|
||||
{ "<leader>hc", desc = "Commands" },
|
||||
{ "<leader>hd", group = "Dap", icon = "" },
|
||||
{ "<leader>hdC", desc = "Configurations" },
|
||||
{ "<leader>hdb", desc = "Breakpoints" }, { "<leader>hdc", desc = "Commands" },
|
||||
{ "<leader>hdf", desc = "Frames" }, { "<leader>hdv", desc = "Variables" },
|
||||
{ "<leader>hk", desc = "Keymaps" }, { "<leader>hs", desc = "Spell Suggest" },
|
||||
{ "<leader>hv", desc = "Vim Options" },
|
||||
{ "<leader>i", group = "Insert", icon = "" },
|
||||
{ "<leader>is", group = "Snippet" }, { "<leader>isp", desc = "Python File" },
|
||||
{ "<leader>j", desc = "Any Jump", icon = "" },
|
||||
{ "<leader>l", group = "LSP", icon = "" },
|
||||
{ "<leader>lD", desc = "Diagnostics" }, { "<leader>lR", desc = "Rename" },
|
||||
{ "<leader>la", desc = "Code Actions" }, { "<leader>lc", group = "Calls" },
|
||||
{ "<leader>lci", desc = "Incoming" }, { "<leader>lco", desc = "Outgoing" },
|
||||
{ "<leader>ld", desc = "Definitions" },
|
||||
{ "<leader>lh", desc = "Signature Help" },
|
||||
{ "<leader>li", desc = "Implementations" },
|
||||
{ "<leader>lr", desc = "References" },
|
||||
{ "<leader>ls", desc = "Document Symbols" },
|
||||
{ "<leader>lt", desc = "Type Definitions" },
|
||||
{ "<leader>lw", desc = "Workspace Symbols" },
|
||||
{ "<leader>n", desc = "NvimTree" },
|
||||
{ "<leader>o", group = "Open", icon = "" }, { "<leader>oB", desc = "Btop" },
|
||||
{ "<leader>oC", desc = "Nvim Config" },
|
||||
{ "<leader>oP", desc = "Ipython (fullscreen)" },
|
||||
{ "<leader>ob", desc = "File Browser" }, { "<leader>oc", desc = "ChatGPT" },
|
||||
{ "<leader>od", desc = "Lazydocker" },
|
||||
{ "<leader>of", desc = "Floating Terminal" },
|
||||
{ "<leader>oh", desc = "Horizontal Terminal" },
|
||||
{ "<leader>op", desc = "Ipython" }, { "<leader>or", desc = "Ranger" },
|
||||
{ "<leader>ot", desc = "Vertical Terminal" }, { "<leader>s", group = "Search" },
|
||||
{ "<leader>sC", desc = "Commands" },
|
||||
{ "<leader>sc", desc = "Clear Highlights" }, { "<leader>sf", desc = "Files" },
|
||||
{ "<leader>sG", desc = "Glyph" }, { "<leader>sg", desc = "Grep" },
|
||||
{ "<leader>sh", desc = "Command History" },
|
||||
{ "<leader>sm", desc = "Man Pages" }, { "<leader>t", group = "Toggle" },
|
||||
{ "<leader>tP", desc = "Ipython (fullscreen)" },
|
||||
{ "<leader>tc", desc = "Colorscheme" }, { "<leader>td", desc = "DBUI" },
|
||||
{ "<leader>tf", desc = "Floating Terminal" },
|
||||
{ "<leader>tp", desc = "Ipython" }, { "<leader>tt", desc = "Split Terminal" },
|
||||
{ "<leader>w", group = "Workspace" }, { "<leader>wa", desc = "Add Folder" },
|
||||
{ "<leader>wl", desc = "List Folders" },
|
||||
{ "<leader>wr", desc = "Remove Folder" },
|
||||
{ "<leader>x", group = "Set Executable Bit", desc = "Set Executable Bit" },
|
||||
{ "<leader>y", desc = "System Yank", icon = "" },
|
||||
{ "<leader>e", desc = "Edit", icon = "" }
|
||||
})
|
||||
@@ -1,11 +0,0 @@
|
||||
local diagnostics_active = true
|
||||
local toggle_diagnostics = function()
|
||||
diagnostics_active = not diagnostics_active
|
||||
if diagnostics_active then
|
||||
vim.diagnostic.show()
|
||||
else
|
||||
vim.diagnostic.hide()
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set('n', '<leader>td', toggle_diagnostics)
|
||||
Reference in New Issue
Block a user