Nvim: update most of the plugins

This commit is contained in:
Robert Kmieć
2024-02-26 12:51:21 +01:00
parent 71f71cb3ce
commit c55b301dc4
34 changed files with 439 additions and 531 deletions

View File

@@ -1,14 +1,20 @@
vim.g.loaded = 1 vim.g.loaded = 1
vim.g.loaded_netrwPlugin = 1 -- uncomment to disable netrw, but nvim scp://xx will not work:
-- vim.g.loaded_netrwPlugin = 1
vim.g.plug_install = 0 vim.g.plug_install = 0
vim.opt.termguicolors = true vim.opt.termguicolors = true
vim.opt.startofline = true vim.opt.startofline = true
vim.g.loaded_ruby_provider = 0
vim.g.loaded_perl_provider = 0
vim.opt.conceallevel = 1
vim.opt.shell = '/bin/bash' vim.opt.shell = '/bin/bash'
vim.opt.number = true vim.opt.number = true
--vim.o.relativenumber = 1 --vim.o.relativenumber = 1
vim.opt.numberwidth = 1 vim.opt.numberwidth = 2
vim.opt.clipboard = "unnamedplus" vim.opt.clipboard = "unnamedplus"
vim.opt.showmode = true vim.opt.showmode = true
@@ -68,14 +74,14 @@ vim.opt.cmdheight = 1
vim.opt.shortmess:append('c') vim.opt.shortmess:append('c')
vim.opt.shortmess:remove('F') vim.opt.shortmess:remove('F')
vim.opt.signcolumn = "auto" vim.opt.signcolumn = "yes"
vim.opt.wildmode = { "longest", "list", "full" } vim.opt.wildmode = { "longest", "list", "full" }
vim.opt.completeopt = { "menu", "menuone", "noselect" } vim.opt.completeopt = { "menu", "menuone", "noselect" }
vim.opt.mouse = "" vim.opt.mouse = ""
--match Error /\s\+$\|DU\cPA/ vim.cmd.match([[Error /\s\+$\|DU\cPA/]])
vim.opt.virtualedit = "block" vim.opt.virtualedit = "block"
vim.opt.shiftround = true vim.opt.shiftround = true
@@ -96,3 +102,30 @@ vim.opt.wildignore = [[
*/tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**" */tmp/*,*.so,*.swp,*.zip,**/node_modules/**,**/target/**,**.terraform/**"
]] ]]
-- Only setup gnvim when it attaches.
vim.api.nvim_create_autocmd({'UIEnter'}, {
callback = function(event)
local chanid = vim.v.event['chan']
local chan = vim.api.nvim_get_chan_info(chanid)
if chan.client and chan.client.name ~= 'gnvim' then
return
end
-- Gnvim brings its own runtime files.
local gnvim = require('gnvim')
-- Set the font
vim.opt.guifont = 'iM WritingMonoS Nerd Font'
-- Increase/decrease font.
vim.keymap.set('n', '<c-+>', function() gnvim.font_size(1) end)
vim.keymap.set('n', '<c-->', function() gnvim.font_size(-1) end)
gnvim.setup({
cursor = {
blink_transition = 300
}
})
end
})

View File

@@ -1,6 +1,6 @@
local map = vim.keymap.set local map = vim.keymap.set
local default_options = { noremap = true, silent = true } local default_options = { noremap = true, silent = true }
local expr_options = { noremap = true, expr = true, silent = true } --local expr_options = { noremap = true, expr = true, silent = true }
-- space one line, home,end globally increase/decrease -- space one line, home,end globally increase/decrease
map('n', '<Home>', 'zc', default_options) map('n', '<Home>', 'zc', default_options)
@@ -26,94 +26,3 @@ map('v', 'P', '"_dP', default_options)
map('n', '<leader>2', '<cmd>set tabstop=2 softtabstop=2 shiftwidth=2<cr>', default_options) map('n', '<leader>2', '<cmd>set tabstop=2 softtabstop=2 shiftwidth=2<cr>', default_options)
map('n', '<leader>4', '<cmd>set tabstop=4 softtabstop=4 shiftwidth=4<cr>', default_options) map('n', '<leader>4', '<cmd>set tabstop=4 softtabstop=4 shiftwidth=4<cr>', default_options)
map('n', '<leader>8', '<cmd>set tabstop=8 softtabstop=8 shiftwidth=8<cr>', default_options) map('n', '<leader>8', '<cmd>set tabstop=8 softtabstop=8 shiftwidth=8<cr>', default_options)
-- digraphs
map('i', '<C-k>d', '<cmd>lua require("better-digraphs").digraphs("i")<cr>', default_options)
-- femaco
--map('n', '<leader>fe'. '<cmd>FeMaCo<cr>', expr_options)
-- fterm
map('n', '<leader>i', '<cmd>lua require("FTerm").toggle()<CR>', default_options)
map('t', '<leader>i', '<cmd>lua require("FTerm").toggle()<CR>', default_options)
-- icon picker
-- map('n', '<C-k>i', '<cmd>IconPickerNormal<cr>', default_options)
-- map('n', '<C-k>y', '<cmd>IconPickerYank<cr>', default_options)
-- map('i', '<C-k>i', '<cmd>IconPickerInsert<cr>', default_options)
-- iswap
map('n', '<leader>sw', '<cmd>ISwapWith<cr>', default_options)
map('n', '<leader>ss', '<cmd>ISwap<cr>', default_options)
-- code window
require('codewindow').apply_default_keybinds()
-- nvim tree
map('n', '<leader>tt', '<cmd>NvimTreeToggle<cr>', default_options)
map('n', '<leader>tf', '<cmd>NvimTreeFindFile<cr>', default_options)
-- other
-- map('n', '<leader>oo', '<cmd>Other<cr>', default_options)
-- map('n', '<leader>os', '<cmd>OtherSplit<cr>', default_options)
-- map('n', '<leader>ov', '<cmd>OtherVSplit<cr>', default_options)
-- map('n', '<leader>oc', '<cmd>OtherClear<cr>', default_options)
-- Context specific bindings
-- map('n', '<leader>ot', '<cmd>Other test<cr>', default_options)
-- map('n', '<leader>os', '<cmd>Other scss<cr>', default_options)
-- quicknote
map('n', '<leader>qn', '<cmd>lua require("quicknote").NewNoteAtCurrentLine()<cr>', default_options)
map('n', '<leader>qs', '<cmd>lua require("quicknote").ShowNoteSigns()<cr>', default_options)
map('n', '<leader>qe', '<cmd>lua require("quicknote").OpenNoteAtCurrentLine()<cr>', default_options)
map('n', '<leader>qd', '<cmd>lua require("quicknote").DeleteNoteAtCurrentLine()<cr>', default_options)
-- telescope
map('n', '<leader>f', '<cmd>lua require("telescope").extensions.menufacture.find_files()<cr>', default_options)
map('n', '<leader>a', '<cmd>lua require("telescope").extensions.menufacture.grep_string()<cr>', default_options)
map('n', '<leader>A', '<cmd>lua require("telescope").extensions.menufacture.live_grep()<cr>', default_options)
map('n', '<leader>b', '<cmd>lua require("telescope.builtin").buffers()<cr>', default_options)
map('n', '<leader>r', '<cmd>lua require("telescope.builtin").resume()<cr>', default_options)
-- map('n', '<leader>fh', '<cmd>lua require('telescope.builtin').help_tags()<cr>, default_options)
map('n', '<leader>tc', '<cmd>lua require("telescope.builtin").commands()<cr>', default_options)
map('n', '<leader>t:', '<cmd>lua require("telescope.builtin").command_history()<cr>', default_options)
map('n', '<leader>t/', '<cmd>lua require("telescope.builtin").search_history()<cr>', default_options)
map('n', '<leader>tr', '<cmd>lua require("telescope.builtin").registers()<cr>', default_options)
-- Neovim lsp pickers
map('n', '<leader>tr', '<cmd>lua require("telescope.builtin").lsp_references()<cr>', default_options)
map('n', '<leader>td', '<cmd>lua require("telescope.builtin").lsp_definitions()<cr>', default_options)
-- git pickers
map('n', '<leader>gc', '<cmd>lua require("telescope.builtin").git_commits()<cr>', default_options)
map('n', '<leader>gC', '<cmd>lua require("telescope.builtin").git_bcommits()<cr>', default_options)
map('n', '<leader>gb', '<cmd>lua require("telescope.builtin").git_branches()<cr>', default_options)
-- map('n', '<leader>s', '<cmd>lua require('telescope').extensions.ultisnips.ultisnips()<cr>, default_options)
map('n', '<leader>u', '<cmd>lua require("telescope").extensions.undo.undo()<cr>', default_options)
-- toggler not active
--vim.keymap.set({'n', 'v'}, 'gt', require('nvim-toggler').toggle)
-- windows
map('n', '<C-w>z', "<cmd>WindowsMaximize<cr>", default_options)
map('n', '<C-w>_', "<cmd>WindowsMaximizeVertically<cr>", default_options)
map('n', '<C-w>|', "<cmd>WindowsMaximizeHorizontally<cr>", default_options)
map('n', '<C-w>=', "<cmd>WindowsEqualize<cr>", default_options)
-- specs
map('n', 'n', 'n:lua require("specs").show_specs()<CR>', default_options)
map('n', 'N', 'N:lua require("specs").show_specs()<CR>', default_options)
map('n', '<leader><space>', function()
vim.cmd.noh()
require("specs").show_specs({width = 97, winhl = "Search", delay_ms = 610, inc_ms = 21})
end, default_options)
vim.api.nvim_set_keymap('n', '<leader>cb', ':lua require("nvim-navbuddy").open()<cr>', default_options)
-- dap
map('v', 'K', '<cmd>lua require("dapui").eval()<cr>', default_options)
map('n', '<leader>dc', ':lua require("dap").continue()<cr>', default_options);
map('n', '<leader>db', ':lua require("dap").toggle_breakpoint()<cr>', default_options);
map('n', '<leader>dB', ':lua require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: "))<cr>', default_options);
map('n', '<leader>dn', ':lua require("dap").step_over()<cr>', default_options);
map('n', '<leader>di', ':lua require("dap").step_into()<cr>', default_options);
map('n', '<leader>do', ':lua require("dap").step_out()<cr>', default_options);
map('n', '<leader>dl', ':lua require("dap").run_last()<cr>', default_options);

View File

@@ -9,10 +9,14 @@ if not vim.loop.fs_stat(lazypath) then
lazypath, lazypath,
}) })
end end
--vim.opt.rtp:append(lazypath)
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
vim.opt.rtp:append(lazypath) vim.opt.rtp:prepend(lazypath)
require'lazy'.setup('plugins') require'lazy'.setup('plugins', {
change_detection = {
enabled = true,
notify = false
}
})

View File

@@ -8,7 +8,6 @@ return {
}, },
-- User defined loops -- User defined loops
additions = { additions = {
{'tic', 'tac', 'toe'},
{'light', 'dark'}, {'light', 'dark'},
{'phaseOne', 'phaseTwo', 'phaseThree'}, {'phaseOne', 'phaseTwo', 'phaseThree'},
{'PhaseOne', 'PhaseTwo', 'PhaseThree'}, {'PhaseOne', 'PhaseTwo', 'PhaseThree'},

View File

@@ -87,7 +87,35 @@ return {{
"bluz71/vim-moonfly-colors", "bluz71/vim-moonfly-colors",
lazy = false, lazy = false,
config = function() config = function()
vim.cmd.colorscheme('moonfly') --vim.cmd.colorscheme('moonfly')
end
},
{
"kuznetsss/meadow.nvim",
lazy = false,
config = function()
--require('meadow').setup()
--vim.cmd.colorscheme('meadow')
--vim.cmd [[ hi! Conceal guibg=black ]]
end
},
{
"kepano/flexoki-neovim",
lazy = false,
config = function()
--vim.cmd.colorscheme('flexoki-dark')
end
},
{
"https://gitlab.com/bartekjaszczak/distinct-nvim",
priority = 1000,
config = function()
require("distinct").setup({
doc_comments_different_color = true, -- Use different colour for documentation comments
})
vim.cmd.colorscheme('distinct')
end end
} }
} }

View File

@@ -1,4 +1,4 @@
return { return {{
-- :DataViewer -- :DataViewer
-- :DataViewer [filepath] [filetype] -- :DataViewer [filepath] [filetype]
-- :DataViewerNextTable -- :DataViewerNextTable
@@ -8,5 +8,10 @@ return {
opts = {}, opts = {},
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",
} },
} ft = { "csv" }
},
{
"chrisbra/csv.vim",
ft = { "csv" }
}}

View File

@@ -1,4 +0,0 @@
return {
'rcarriga/nvim-dap-ui',
config = true
}

View File

@@ -1,37 +0,0 @@
return {
'theHamsta/nvim-dap-virtual-text',
config = function()
require("nvim-dap-virtual-text").setup{
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
--- A callback that determines how a variable is displayed or whether it should be omitted
--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- @param buf number
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
display_callback = function(variable, buf, stackframe, node, options)
if options.virt_text_pos == 'inline' then
return ' = ' .. variable.value
else
return variable.name .. ' = ' .. variable.value
end
end,
-- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line
virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol',
-- experimental features:
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
}
end
}

View File

@@ -1,4 +1,5 @@
return { return {
{
'mfussenegger/nvim-dap', 'mfussenegger/nvim-dap',
config = function() config = function()
local dap = require("dap") local dap = require("dap")
@@ -29,5 +30,119 @@ return {
cwd = "${workspaceFolder}", cwd = "${workspaceFolder}",
}, },
} }
dap.configurations.python = {
{
-- The first three options are required by nvim-dap
type = 'python'; -- the type here established the link to the adapter definition: `dap.adapters.python`
request = 'launch';
name = "Launch file";
-- Options below are for debugpy, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings for supported options
program = "${file}"; -- This configuration will launch the current file if used.
pythonPath = function()
-- debugpy supports launching an application with a different interpreter then the one used to launch debugpy itself.
-- The code below looks for a `venv` or `.venv` folder in the current directly and uses the python within.
-- You could adapt this - to for example use the `VIRTUAL_ENV` environment variable.
local cwd = vim.fn.getcwd()
if vim.fn.executable(cwd .. '/venv/bin/python') == 1 then
return cwd .. '/venv/bin/python'
elseif vim.fn.executable(cwd .. '/.venv/bin/python') == 1 then
return cwd .. '/.venv/bin/python'
else
return '/usr/bin/python3'
end
end;
}
}
dap.adapters.python = function(cb, config)
if config.request == 'attach' then
---@diagnostic disable-next-line: undefined-field
local port = (config.connect or config).port
---@diagnostic disable-next-line: undefined-field
local host = (config.connect or config).host or '127.0.0.1'
cb({
type = 'server',
port = assert(port, '`connect.port` is required for a python `attach` configuration'),
host = host,
options = {
source_filetype = 'python',
},
})
else
cb({
type = 'executable',
command = '/home/kmcr/.virtualenvs/debugpy/bin/python',
args = { '-m', 'debugpy.adapter' },
options = {
source_filetype = 'python',
},
})
end
end
local def = { noremap = true, silent = true }
vim.keymap.set('n', '\\c', function() require("dap").continue() end, def);
vim.keymap.set('n', '\\b', function() require("dap").toggle_breakpoint() end, def);
vim.keymap.set('n', '\\B', function() require("dap").set_breakpoint(vim.fn.input("Breakpoint condition: ")) end, def);
vim.keymap.set('n', '\\n', function() require("dap").step_over() end, def);
vim.keymap.set('n', '\\s', function() require("dap").step_into() end, def);
vim.keymap.set('n', '\\u', function() require("dap").step_out() end, def);
vim.keymap.set('n', '\\l', function() require("dap").run_last() end, def);
end
},
{
'rcarriga/nvim-dap-ui',
dependencies = {
'mfussenegger/nvim-dap'
},
config = function()
local ui = require('dapui')
local dap = require('dap')
local def = { noremap = true, silent = true }
vim.keymap.set('n', '\\d', function()
dap.continue()
ui.toggle({})
end, def)
vim.keymap.set('v', 'K', function() require("dapui").eval() end, def)
ui.setup()
end
},
{
'theHamsta/nvim-dap-virtual-text',
config = function()
require("nvim-dap-virtual-text").setup{
enabled = true, -- enable this plugin (the default)
enabled_commands = true, -- create commands DapVirtualTextEnable, DapVirtualTextDisable, DapVirtualTextToggle, (DapVirtualTextForceRefresh for refreshing when debug adapter did not notify its termination)
highlight_changed_variables = true, -- highlight changed values with NvimDapVirtualTextChanged, else always NvimDapVirtualText
highlight_new_as_changed = false, -- highlight new variables in the same way as changed variables (if highlight_changed_variables)
show_stop_reason = true, -- show stop reason when stopped for exceptions
commented = false, -- prefix virtual text with comment string
only_first_definition = true, -- only show virtual text at first definition (if there are multiple)
all_references = false, -- show virtual text on all all references of the variable (not only definitions)
clear_on_continue = false, -- clear virtual text on "continue" (might cause flickering when stepping)
--- A callback that determines how a variable is displayed or whether it should be omitted
--- @param variable Variable https://microsoft.github.io/debug-adapter-protocol/specification#Types_Variable
--- @param buf number
--- @param stackframe dap.StackFrame https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame
--- @param node userdata tree-sitter node identified as variable definition of reference (see `:h tsnode`)
--- @param options nvim_dap_virtual_text_options Current options for nvim-dap-virtual-text
--- @return string|nil A text how the virtual text should be displayed or nil, if this variable shouldn't be displayed
display_callback = function(variable, buf, stackframe, node, options)
if options.virt_text_pos == 'inline' then
return ' = ' .. variable.value
else
return variable.name .. ' = ' .. variable.value
end
end,
-- position of virtual text, see `:h nvim_buf_set_extmark()`, default tries to inline the virtual text. Use 'eol' to set to end of line
virt_text_pos = vim.fn.has 'nvim-0.10' == 1 and 'inline' or 'eol',
-- experimental features:
all_frames = false, -- show virtual text for all stack frames not only current. Only works for debugpy on my machine.
virt_lines = false, -- show virtual lines instead of virtual text (will flicker!)
virt_text_win_col = nil -- position the virtual text at a fixed window column (starting from the first text column) ,
}
end end
} }
}

View File

@@ -14,13 +14,14 @@ return {
width = 100, width = 100,
border = "rounded", border = "rounded",
}, },
wrap = false, -- text wrap, only applies to floating window wrap = true, -- text wrap, only applies to floating window
previewer_cmd = nil, -- for example: "glow" previewer_cmd = nil, -- for example: "glow"
cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "80" } cmd_args = {}, -- example using glow: { "-s", "dark", "-w", "80" }
cmd_ignore = {}, -- ignore cmd rendering for the listed docs cmd_ignore = {}, -- ignore cmd rendering for the listed docs
picker_cmd = false, -- use cmd previewer in picker preview picker_cmd = false, -- use cmd previewer in picker preview
picker_cmd_args = {}, -- example using glow: { "-p" } picker_cmd_args = {}, -- example using glow: { "-p" }
ensure_installed = {}, -- get automatically installed ensure_installed = nil, -- get automatically installed
after_open = function(bufnr) end, -- callback that runs after the Devdocs window is opened. Devdocs buffer ID will be passed in after_open = function(bufnr) end, -- callback that runs after the Devdocs window is opened. Devdocs buffer ID will be passed in
} },
event = "VeryLazy"
} }

View File

@@ -1,167 +1,6 @@
return { return {
'stevearc/dressing.nvim', 'stevearc/dressing.nvim',
enabled = false, enabled = true,
opts = { opts = {
input = {
-- Set to false to disable the vim.ui.input implementation
enabled = true,
-- Default prompt string
default_prompt = "Input:",
-- Can be 'left', 'right', or 'center'
prompt_align = "left",
-- When true, <Esc> will close the modal
insert_only = true,
-- When true, input will start in insert mode.
start_in_insert = true,
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "cursor",
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
prefer_width = 40,
width = nil,
-- min_width and max_width can be a list of mixed types.
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
buf_options = {},
win_options = {
-- Window transparency (0-100)
winblend = 10,
-- Disable line wrapping
wrap = false,
list = true,
listchars = "precedes:…,extends:…",
-- Increase this for more context when text scrolls off the window
sidescrolloff = 0,
},
-- Set to `false` to disable
mappings = {
n = {
["<Esc>"] = "Close",
["<CR>"] = "Confirm",
},
i = {
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
["<Up>"] = "HistoryPrev",
["<Down>"] = "HistoryNext",
},
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
-- see :help dressing_get_config
get_config = nil,
},
select = {
-- Set to false to disable the vim.ui.select implementation
enabled = true,
-- Priority list of preferred vim.select implementations
backend = { "telescope", "fzf_lua", "fzf", "builtin", "nui" },
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
-- Options for fzf selector
fzf = {
window = {
width = 0.5,
height = 0.4,
},
},
-- Options for fzf_lua selector
fzf_lua = {
winopts = {
width = 0.5,
height = 0.4,
},
},
-- Options for nui Menu
nui = {
position = "50%",
size = nil,
relative = "editor",
border = {
style = "rounded",
},
buf_options = {
swapfile = false,
filetype = "DressingSelect",
},
win_options = {
winblend = 10,
},
max_width = 80,
max_height = 40,
min_width = 40,
min_height = 10,
},
-- Options for built-in selector
builtin = {
-- These are passed to nvim_open_win
border = "rounded",
-- 'editor' and 'win' will default to being centered
relative = "editor",
buf_options = {},
win_options = {
-- Window transparency (0-100)
winblend = 10,
cursorline = true,
cursorlineopt = "both",
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
width = nil,
max_width = { 140, 0.8 },
min_width = { 40, 0.2 },
height = nil,
max_height = 0.9,
min_height = { 10, 0.2 },
-- Set to `false` to disable
mappings = {
["<Esc>"] = "Close",
["<C-c>"] = "Close",
["<CR>"] = "Confirm",
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Used to override format_item. See :help dressing-format
format_item_override = {},
-- see :help dressing_get_config
get_config = nil,
},
} }
} }

View File

@@ -1,4 +1,7 @@
return { return {
'AckslD/nvim-FeMaco.lua', 'AckslD/nvim-FeMaco.lua',
config = true config = function()
require('femaco').setup()
vim.keymap.set('n', '<leader>!', '<cmd>FeMaCo<cr>', { noremap = true, silent = true })
end,
} }

View File

@@ -1,6 +1,7 @@
return { return {
'numToStr/FTerm.nvim', 'numToStr/FTerm.nvim',
opts = { config = function()
require('FTerm').setup({
-- Filetype of the terminal buffer -- Filetype of the terminal buffer
ft = 'FTerm', ft = 'FTerm',
@@ -40,5 +41,10 @@ return {
-- Callback invoked when the terminal emits stderr data. -- Callback invoked when the terminal emits stderr data.
-- See `:h jobstart-options` -- See `:h jobstart-options`
on_stderr = nil, on_stderr = nil,
} })
vim.keymap.set('n', '<leader>i', '<cmd>lua require("FTerm").toggle()<CR>', { noremap = true, silent = true })
vim.keymap.set('t', '<leader>i', '<cmd>lua require("FTerm").toggle()<CR>', { noremap = true, silent = true })
end,
enabled = false
} }

View File

@@ -1,7 +1,20 @@
return { return {{
'ziontee113/icon-picker.nvim', 'ziontee113/icon-picker.nvim',
config = function() config = function()
require("icon-picker").setup({disable_legacy_commands = true }) require("icon-picker").setup({disable_legacy_commands = true })
end, end,
enabled = false -- icon picker
-- map('n', '<C-k>i', '<cmd>IconPickerNormal<cr>', default_options)
-- map('n', '<C-k>y', '<cmd>IconPickerYank<cr>', default_options)
-- map('i', '<C-k>i', '<cmd>IconPickerInsert<cr>', default_options)
enabled = false,
},
{
'2kabhishek/nerdy.nvim',
dependencies = {
'stevearc/dressing.nvim',
'nvim-telescope/telescope.nvim',
},
cmd = 'Nerdy',
}
} }

View File

@@ -1,33 +1,10 @@
return {{ return {{
--"inside/vim-search-pulse", -- "MunifTanjim/nui.nvim",
"MunifTanjim/nui.nvim", -- "nvim-lua/plenary.nvim",
"nvim-lua/plenary.nvim",
"wellle/targets.vim",
"tpope/vim-fugitive",
"chrisbra/csv.vim",
--"iamcco/markdown-preview.nvim",, { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']} --"iamcco/markdown-preview.nvim",, { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
--"euclio/vim-markdown-composer",, {'do': ':!cargo build --release --locked'}
--"vim-pandoc/vim-pandoc", --"vim-pandoc/vim-pandoc",
--"junegunn/goyo.vim",
"protex/better-digraphs.nvim",
--"RRethy/vim-hexokinase",, { 'do': 'make hexokinase' } --"RRethy/vim-hexokinase",, { 'do': 'make hexokinase' }
--"euclio/vim-markdown-composer",, {'do': ':!cargo build --release --locked'}
--"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
--require('lsp_lines').setup()
--"rgroli/other.nvim", " Currently doesn't support C/C++
"Pocco81/true-zen.nvim",
"nullchilly/fsread.nvim",
{
"cbochs/grapple.nvim",
enabled = false
},
{
"shortcuts/no-neck-pain.nvim",
enabled = false,
},
}} }}

View File

@@ -17,6 +17,7 @@ return {
vim.keymap.set("v", "<localleader>r", ":<C-u>MoltenEvaluateVisual<CR>gv", vim.keymap.set("v", "<localleader>r", ":<C-u>MoltenEvaluateVisual<CR>gv",
{ silent = true, noremap = true, desc = "evaluate visual selection" }) { silent = true, noremap = true, desc = "evaluate visual selection" })
end, end,
ft = { 'markdown', 'jupyter' }
}, },
{ {
-- see the image.nvim readme for more information about configuring this plugin -- see the image.nvim readme for more information about configuring this plugin

View File

@@ -19,4 +19,5 @@ return {
-- hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false, hint_offset = 1 }) -- hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = false, hint_offset = 1 })
-- end, {remap=true}) -- end, {remap=true})
end, end,
enabled = false
} }

View File

@@ -1,10 +1,11 @@
return { return {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
"SmiteshP/nvim-navbuddy", -- "SmiteshP/nvim-navbuddy",
{url = "http://git.sr.ht/~p00f/clangd_extensions.nvim"}, {url = "http://git.sr.ht/~p00f/clangd_extensions.nvim"},
"jubnzv/virtual-types.nvim", "jubnzv/virtual-types.nvim",
"ray-x/lsp_signature.nvim", --"ray-x/lsp_signature.nvim",
"folke/neodev.nvim" "folke/neodev.nvim"
}, },
config = function() config = function()
@@ -93,50 +94,47 @@ return {
} }
} }
}) })
local lsp_signature = require('lsp_signature') --local lsp_signature = require('lsp_signature')
-- Mappings. -- Mappings.
local opts = { noremap=true, silent=true } vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float)
vim.api.nvim_set_keymap('n', '<leader>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) vim.keymap.set('n', '<leader>E', vim.diagnostic.setloclist)
vim.api.nvim_set_keymap('n', '<leader>E', '<cmd>lua vim.diagnostic.set_loclist()<CR>', opts)
vim.api.nvim_set_keymap("n", "<leader>q", "<cmd>lua vim.lsp.buf.format{ async = true }<CR>", opts)
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
local on_attach = function(client, bufnr) vim.api.nvim_create_autocmd('LspAttach', {
--Enable completion triggered by <c-x><c-o> group = vim.api.nvim_create_augroup('UserLspConfig', {}),
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') callback = function(ev)
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
---- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts) local opts = { buffer = ev.buf }
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts) vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts) vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts) --vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, 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.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts) --vim.keymap.set('n', '<space>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts) vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
--vim.api.nvim_buf_set_keymap(bufnr, 'n', '<leader>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts) vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts) --vim.keymap.set('n', '<leader>ca', vim.lsp.buf.code_action, opts)
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<F6>', '<cmd>ClangdSwitchSourceHeader<cr>', opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set('n', '<F6>', '<cmd>ClangdSwitchSourceHeader<CR>', opts)
vim.keymap.set("n", "<leader>q", function() vim.lsp.buf.format{ async = true } end, opts)
-- require'illuminate'.on_attach(client)
require'virtualtypes'.on_attach() require'virtualtypes'.on_attach()
require'lsp_signature'.on_attach({ -- require'lsp_signature'.on_attach({
floating_window = true, -- floating_window = true,
floating_window_above_cur_line = false, -- floating_window_above_cur_line = true,
floating_window_off_x = 500, -- floating_window_off_x = 10,
floating_window_off_y = -5, -- floating_window_off_y = 0,
}) -- })
require'nvim-navbuddy'.attach(client, bufnr)
require'nvim-navic'.attach(client, bufnr)
require("clangd_extensions.inlay_hints").setup_autocmd() require("clangd_extensions.inlay_hints").setup_autocmd()
require("clangd_extensions.inlay_hints").set_inlay_hints() require("clangd_extensions.inlay_hints").set_inlay_hints()
end
local signs = { local signs = {
{ name = "DiagnosticSignError", text = "" }, { name = "DiagnosticSignError", text = "" },
@@ -151,60 +149,29 @@ return {
vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with( vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
vim.lsp.diagnostic.on_publish_diagnostics, { vim.lsp.diagnostic.on_publish_diagnostics, {
signs = { signs = false,
active = signs,
--severity_limit = 'info',
},
severity_sort = true, severity_sort = true,
underline = false, underline = true,
update_in_insert = false, update_in_insert = false,
--virtual_text = { virtual_text = {
-- spacing = 40, spacing = 30,
-- severity_limit = 'Warning', },
--}, float = true
virtual_text = false,
} }
) )
end
})
local capabilities = require('cmp_nvim_lsp').default_capabilities() local capabilities = require('cmp_nvim_lsp').default_capabilities()
capabilities.offsetEncoding = { "utf-16" } capabilities.offsetEncoding = { "utf-16" }
nvim_lsp.groovyls.setup({ nvim_lsp.groovyls.setup({
cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" }, cmd = { "java", "-jar", "/home/kmcr/tools/groovy-language-server/build/libs/groovy-language-server-all.jar" },
on_attach = on_attach,
--on_publish_diagnostics = diagnostic_handler,
capabilities = capabilities capabilities = capabilities
}) })
-- nvim_lsp.ccls.setup(
-- coq.lsp_ensure_capabilities({
-- init_options = {
-- compilationDatabaseDirectory = ".";
-- index = {
-- threads = 0;
-- },
-- clang = {
-- excludeArgs = { "-frounding-math"} ;
-- },
-- },
-- root_dir = nvim_lsp.util.root_pattern("compile_commands.json"),
-- on_attach = on_attach,
-- on_publish_diagnostics = diagnostic_handler,
-- flags = {
-- debounce_text_changes = 150,
-- }}
-- )
-- )
nvim_lsp.clangd.setup({ nvim_lsp.clangd.setup({
settings = {
},
on_attach = on_attach,
--on_publish_diagnostics = diagnostic_handler,
capabilities = capabilities, capabilities = capabilities,
-- flags = {
-- debounce_text_changes = 150,
-- }
}) })
nvim_lsp.pylsp.setup({ nvim_lsp.pylsp.setup({
@@ -216,12 +183,7 @@ return {
enabled = false, enabled = false,
}, },
}, },
-- flags = {
-- debounce_text_changes = 150,
-- },
on_attach = on_attach,
capabilities = capabilities capabilities = capabilities
--on_publish_diagnostics = diagnostic_handler,
}) })
nvim_lsp.lua_ls.setup({ nvim_lsp.lua_ls.setup({
@@ -237,23 +199,29 @@ return {
nvim_lsp.matlab_ls.setup({ nvim_lsp.matlab_ls.setup({
cmd = { "matlab-language-server", "--stdio"}, cmd = { "matlab-language-server", "--stdio"},
filetypes = { "matlab" }, filetypes = { "matlab" },
handlers = { [ "workspace/configuration"] = function(_, _, ctx) -- handlers = { [ "workspace/configuration"] = function(_, _, ctx)
local client = vim.lsp.get_client_by_id(ctx.client_id) -- local client = vim.lsp.get_client_by_id(ctx.client_id)
return {client.config.settings.matlab} -- return {client.config.settings.matlab}
end -- end
}, -- },
root_dir = nvim_lsp.util.find_git_ancestor, root_dir = nvim_lsp.util.find_git_ancestor,
single_file_support = false, single_file_support = true,
settings = { settings = {
matlab = { matlab = {
indexWorkspace = true, indexWorkspace = false,
installPath = "/usr/local/MATLAB/R2022b", installPath = "/usr/local/MATLAB/R2022b",
matlabConnectionTiming = "onStart", matlabConnectionTiming = "onStart",
telemetry = true, telemetry = true,
}, },
}, }
on_attach = on_attach, })
capabilities = capabilities
nvim_lsp.typos_lsp.setup({
cmd = { 'typos-lsp' },
filetypes = { '*' },
root_dir = nvim_lsp.util.root_pattern('typos.toml', '_typos.toml', '.typos.toml'),
single_file_support = true,
settings = {},
}) })
-- Use a loop to conveniently call 'setup' on multiple servers and -- Use a loop to conveniently call 'setup' on multiple servers and
@@ -261,12 +229,7 @@ return {
local servers = { "cmake", "rust_analyzer", "bashls", "marksman" } local servers = { "cmake", "rust_analyzer", "bashls", "marksman" }
for _, lsp in ipairs(servers) do for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup({ nvim_lsp[lsp].setup({
on_attach = on_attach,
--on_publish_diagnostics = diagnostic_handler,
capabilities = capabilities, capabilities = capabilities,
-- flags = {
-- debounce_text_changes = 150,
-- }
}) })
end end
end end

View File

@@ -1,19 +0,0 @@
return {
"echasnovski/mini.nvim",
version = false,
config = function()
local hipatterns = require('mini.hipatterns')
hipatterns.setup({
highlighters = {
-- Highlight standalone 'FIXME', 'HACK', 'TODO', 'NOTE'
-- fixme = { pattern = '%f[%w]()EFMC 0()%f[%W]', group = 'MiniHipatternsFixme' },
-- hack = { pattern = '%f[%w]()Vehicle 0()%f[%W]', group = 'MiniHipatternsHack' },
-- todo = { pattern = '%f[%w]()CoCo 0()%f[%W]', group = 'MiniHipatternsTodo' },
-- note = { pattern = '%f[%w]()EneM 0()%f[%W]', group = 'MiniHipatternsNote' },
-- Highlight hex color strings (`#rrggbb`) using that color
hex_color = hipatterns.gen_highlighter.hex_color(),
},
})
end
}

View File

@@ -1,5 +1,7 @@
return { return {
-- <leader>mm -- <leader>mm
'gorbit99/codewindow.nvim', 'gorbit99/codewindow.nvim',
config = true, config = function()
require('codewindow').apply_default_keybinds()
end,
} }

View File

@@ -88,5 +88,6 @@ return {
MkdnFoldSection = {'n', '<leader>f'}, MkdnFoldSection = {'n', '<leader>f'},
MkdnUnfoldSection = {'n', '<leader>F'} MkdnUnfoldSection = {'n', '<leader>F'}
} }
} },
enabled = false
} }

View File

@@ -8,5 +8,7 @@ return {
config = function() config = function()
require'nvim-navic'.setup() require'nvim-navic'.setup()
require'nvim-navbuddy'.setup() require'nvim-navbuddy'.setup()
end vim.keymap.set('n', '<leader>cb', ':lua require("nvim-navbuddy").open()<cr>', {noremap = true, silent = true})
end,
enabled = false
} }

View File

@@ -13,7 +13,6 @@ return {
--null_ls.builtins.diagnostics.misspell, --null_ls.builtins.diagnostics.misspell,
null_ls.builtins.diagnostics.hadolint, null_ls.builtins.diagnostics.hadolint,
null_ls.builtins.diagnostics.buf, null_ls.builtins.diagnostics.buf,
null_ls.builtins.diagnostics.typos,
--null_ls.builtins.code_actions.proselint, --null_ls.builtins.code_actions.proselint,
--null_ls.builtins.diagnostics.proselint, --null_ls.builtins.diagnostics.proselint,
null_ls.builtins.hover.dictionary, null_ls.builtins.hover.dictionary,

View File

@@ -7,6 +7,7 @@ return {
'hrsh7th/cmp-buffer', 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-cmdline', 'hrsh7th/cmp-cmdline',
'hrsh7th/cmp-nvim-lsp', 'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-path', 'hrsh7th/cmp-path',
'hrsh7th/cmp-calc', 'hrsh7th/cmp-calc',
}, },
@@ -15,15 +16,18 @@ return {
local cmp = require'cmp' local cmp = require'cmp'
cmp.setup({ cmp.setup({
-- snippet = { snippet = {
-- expand = function(args) expand = function(args)
-- require('snippy').expand_snippet(args.body) require('snippy').expand_snippet(args.body)
-- end, end,
-- }, },
window = { window = {
completion = cmp.config.window.bordered(), completion = cmp.config.window.bordered(),
documentation = cmp.config.window.bordered(), documentation = cmp.config.window.bordered(),
}, },
experimental = {
ghost_text = true,
},
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
@@ -33,6 +37,7 @@ return {
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'nvim_lsp_signature_help' },
{ name = 'path' }, { name = 'path' },
{ name = 'snippy' }, { name = 'snippy' },
{ name = 'calc' }, { name = 'calc' },

View File

@@ -9,7 +9,7 @@ return {
-- following options are the default -- following options are the default
-- each of these are documented in `:help nvim-tree.OPTION_NAME` -- each of these are documented in `:help nvim-tree.OPTION_NAME`
require'nvim-tree'.setup { require'nvim-tree'.setup {
disable_netrw = true, disable_netrw = false,
hijack_netrw = true, hijack_netrw = true,
open_on_tab = false, open_on_tab = false,
hijack_cursor = true, hijack_cursor = true,
@@ -141,5 +141,7 @@ return {
}, },
}, },
} }
vim.keymap.set('n', '<leader>tt', '<cmd>NvimTreeToggle<cr>', { noremap = true, silent = true})
vim.keymap.set('n', '<leader>tf', '<cmd>NvimTreeFindFile<cr>', { noremap = true, silent = true})
end end
} }

View File

@@ -1,31 +0,0 @@
return {
"IlyasYOY/obs.nvim",
dependencies = {
"IlyasYOY/coredor.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
},
--dev = true,
config = function()
local obs = require("obs")
obs.setup({
vault_home = "~/notes",
journal = {
template_name = "daily",
},
})
vim.keymap.set("n", "<leader>nn", "<cmd>ObsNvimFollowLink<cr>")
vim.keymap.set("n", "<leader>nr", "<cmd>ObsNvimRandomNote<cr>")
vim.keymap.set("n", "<leader>nN", "<cmd>ObsNvimNewNote<cr>")
vim.keymap.set("n", "<leader>nd", "<cmd>ObsNvimDailyNote<cr>")
vim.keymap.set("n", "<leader>nrn", "<cmd>ObsNvimRename<cr>")
vim.keymap.set("n", "<leader>nT", "<cmd>ObsNvimTemplate<cr>")
vim.keymap.set("n", "<leader>nM", "<cmd>ObsNvimMove<cr>")
vim.keymap.set("n", "<leader>nb", "<cmd>ObsNvimBacklinks<cr>")
vim.keymap.set("n", "<leader>nfj", "<cmd>ObsNvimFindInJournal<cr>")
vim.keymap.set("n", "<leader>nff", "<cmd>ObsNvimFindNote<cr>")
vim.keymap.set("n", "<leader>nfg", "<cmd>ObsNvimFindInNotes<cr>")
end,
}

View File

@@ -4,5 +4,12 @@ return {
'nvim-lua/plenary.nvim' 'nvim-lua/plenary.nvim'
}, },
config = true, config = true,
-- -- quicknote
-- map('n', '<leader>qn', '<cmd>lua require("quicknote").NewNoteAtCurrentLine()<cr>', default_options)
-- map('n', '<leader>qs', '<cmd>lua require("quicknote").ShowNoteSigns()<cr>', default_options)
-- map('n', '<leader>qe', '<cmd>lua require("quicknote").OpenNoteAtCurrentLine()<cr>', default_options)
-- map('n', '<leader>qd', '<cmd>lua require("quicknote").DeleteNoteAtCurrentLine()<cr>', default_options)
enabled = false enabled = false
} }

View File

@@ -1,5 +1,6 @@
return { return {
'nvimdev/hlsearch.nvim', 'nvimdev/hlsearch.nvim',
event = 'BufRead', event = 'BufRead',
config = true config = true,
enabled = false,
} }

View File

@@ -18,5 +18,14 @@ return {
nofile = true, nofile = true,
}, },
} }
end local map = vim.keymap.set
local def = { noremap = true, silent = true }
map('n', 'n', 'n<cmd>lua require("specs").show_specs()<CR>', def)
map('n', 'N', 'N<cmd>lua require("specs").show_specs()<CR>', def)
map('n', '<leader><space>', function()
vim.cmd.noh()
require("specs").show_specs({width = 97, winhl = "Search", delay_ms = 100, inc_ms = 21})
end, def)
end,
enabled = false
} }

View File

@@ -2,8 +2,58 @@ return {
'Wansmer/symbol-usage.nvim', 'Wansmer/symbol-usage.nvim',
event = 'BufReadPre', -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach' event = 'BufReadPre', -- need run before LspAttach if you use nvim 0.9. On 0.10 use 'LspAttach'
config = function() config = function()
local function h(name) return vim.api.nvim_get_hl(0, { name = name }) end
-- hl-groups can have any name
vim.api.nvim_set_hl(0, 'SymbolUsageRounding', { fg = h('CursorLine').bg, italic = true })
vim.api.nvim_set_hl(0, 'SymbolUsageContent', { bg = h('CursorLine').bg, fg = h('Comment').fg, italic = true })
vim.api.nvim_set_hl(0, 'SymbolUsageRef', { fg = h('Function').fg, bg = h('CursorLine').bg, italic = true })
vim.api.nvim_set_hl(0, 'SymbolUsageDef', { fg = h('Type').fg, bg = h('CursorLine').bg, italic = true })
vim.api.nvim_set_hl(0, 'SymbolUsageImpl', { fg = h('@keyword').fg, bg = h('CursorLine').bg, italic = true })
local function text_format(symbol)
local res = {}
-- local round_start = { '', 'SymbolUsageRounding' }
-- local round_end = { '', 'SymbolUsageRounding' }
if symbol.references then
local usage = symbol.references <= 1 and 'usage' or 'usages'
local num = symbol.references == 0 and 'no' or symbol.references
--table.insert(res, round_start)
table.insert(res, { '󰌹 ', 'SymbolUsageRef' })
table.insert(res, { ('%s %s'):format(num, usage), 'SymbolUsageContent' })
--table.insert(res, round_end)
end
if symbol.definition then
if #res > 0 then
table.insert(res, { ' ', 'NonText' })
end
--table.insert(res, round_start)
table.insert(res, { '󰳽 ', 'SymbolUsageDef' })
table.insert(res, { symbol.definition .. ' defs', 'SymbolUsageContent' })
--table.insert(res, round_end)
end
if symbol.implementation then
if #res > 0 then
table.insert(res, { ' ', 'NonText' })
end
--table.insert(res, round_start)
table.insert(res, { '󰡱 ', 'SymbolUsageImpl' })
table.insert(res, { symbol.implementation .. ' impls', 'SymbolUsageContent' })
--table.insert(res, round_end)
end
return res
end
require('symbol-usage').setup({ require('symbol-usage').setup({
vt_position = "textwidth" vt_position = "above",
references = { enabled = true, include_declaration = true },
definition = { enabled = true },
implementation = { enabled = true },
text_format = text_format,
}) })
end end
} }

View File

@@ -1,4 +1,5 @@
return { return {
'hedyhli/outline.nvim', 'hedyhli/outline.nvim',
config = true config = true,
cmd = { 'OutlineOpen' }
} }

View File

@@ -32,5 +32,28 @@ return {
require('telescope').load_extension('undo') require('telescope').load_extension('undo')
require('telescope').load_extension('menufacture') require('telescope').load_extension('menufacture')
require("telescope").load_extension("emoji") require("telescope").load_extension("emoji")
local def = { noremap = true, silent = true }
local map = vim.keymap.set
map('n', '<leader>r', '<cmd>lua require("telescope.builtin").resume()<cr>', def)
map('n', '<leader>f', '<cmd>lua require("telescope").extensions.menufacture.find_files()<cr>', def)
map('n', '<leader>a', '<cmd>lua require("telescope").extensions.menufacture.grep_string()<cr>', def)
map('n', '<leader>s', '<cmd>lua require("telescope").extensions.menufacture.live_grep()<cr>', def)
map('n', '<leader>b', '<cmd>lua require("telescope.builtin").buffers()<cr>', def)
-- map('n', '<leader>fh', '<cmd>lua require('telescope.builtin').help_tags()<cr>, def)
map('n', '<leader>tc', '<cmd>lua require("telescope.builtin").commands()<cr>', def)
map('n', '<leader>t:', '<cmd>lua require("telescope.builtin").command_history()<cr>', def)
map('n', '<leader>t/', '<cmd>lua require("telescope.builtin").search_history()<cr>', def)
map('n', '<leader>tr', '<cmd>lua require("telescope.builtin").registers()<cr>', def)
-- Neovim lsp pickers
map('n', 'gr', '<cmd>lua require("telescope.builtin").lsp_references()<cr>', def)
map('n', 'gd', '<cmd>lua require("telescope.builtin").lsp_definitions()<cr>', def)
-- git pickers
-- map('n', '<leader>gc', '<cmd>lua require("telescope.builtin").git_commits()<cr>', def)
-- map('n', '<leader>gC', '<cmd>lua require("telescope.builtin").git_bcommits()<cr>', def)
-- map('n', '<leader>gb', '<cmd>lua require("telescope.builtin").git_branches()<cr>', def)
-- other
-- map('n', '<leader>s', '<cmd>lua require('telescope').extensions.ultisnips.ultisnips()<cr>, def)
map('n', '<leader>u', '<cmd>lua require("telescope").extensions.undo.undo()<cr>', def)
end end
} }

View File

@@ -3,7 +3,6 @@ return {
dependencies = { dependencies = {
'mizlan/iswap.nvim', 'mizlan/iswap.nvim',
'romgrk/nvim-treesitter-context', 'romgrk/nvim-treesitter-context',
'Wansmer/sibling-swap.nvim',
--"nvim-treesitter/nvim-treesitter-textobjects", --"nvim-treesitter/nvim-treesitter-textobjects",
--"nvim-treesitter/playground", --"nvim-treesitter/playground",
}, },
@@ -17,11 +16,7 @@ return {
highlight = { highlight = {
enable = true, enable = true,
disable = function(lang, buf) disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB return vim.api.nvim_buf_line_count(buf) > 5000
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, end,
additional_vim_regex_highlighting = false, additional_vim_regex_highlighting = false,
}, },
@@ -86,6 +81,5 @@ return {
} }
-- vim.opt.foldmethod = "expr" -- vim.opt.foldmethod = "expr"
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()" -- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
require('sibling-swap').setup({})
end end
} }

View File

@@ -8,5 +8,11 @@ return {
vim.o.winwidth = 10 vim.o.winwidth = 10
vim.o.winminwidth = 10 vim.o.winminwidth = 10
require("windows").setup() require("windows").setup()
local map = vim.keymap.set
local default_options = { noremap = true, silent = true }
map('n', '<C-w>z', "<cmd>WindowsMaximize<cr>", default_options)
map('n', '<C-w>_', "<cmd>WindowsMaximizeVertically<cr>", default_options)
map('n', '<C-w>|', "<cmd>WindowsMaximizeHorizontally<cr>", default_options)
map('n', '<C-w>=', "<cmd>WindowsEqualize<cr>", default_options)
end end
} }