Nvim: many small changes around whole project
This commit is contained in:
@@ -1,22 +1,3 @@
|
|||||||
require('core.config')
|
require('core.config')
|
||||||
require('core.plugins')
|
require('core.plugins')
|
||||||
require('core.mappings')
|
require('core.mappings')
|
||||||
|
|
||||||
vim.cmd([[
|
|
||||||
"highlight MatchParen cterm=underline ctermbg=black ctermfg=NONE
|
|
||||||
"highlight VirtColumn ctermfg=DarkGrey ctermbg=NONE
|
|
||||||
"hi clear SpellBad
|
|
||||||
"hi SpellBad cterm=underline
|
|
||||||
|
|
||||||
" Ctags {{{
|
|
||||||
if isdirectory($HOME . '/.cache/nvim/tags') == 0
|
|
||||||
:silent !mkdir -p ~/.cache/nvim/tags > /dev/null 2>&1
|
|
||||||
endif
|
|
||||||
let g:gutentags_cache_dir='~/.cache/nvim/tags'
|
|
||||||
|
|
||||||
if isdirectory($HOME . '/.cache/nvim/undo') == 0
|
|
||||||
:silent !mkdir -p ~/.cache/nvim/undo > /dev/null 2>&1
|
|
||||||
endif
|
|
||||||
set undodir=~/.cache/nvim/undo/
|
|
||||||
set undofile
|
|
||||||
]])
|
|
||||||
|
|||||||
@@ -8,6 +8,11 @@ vim.opt.startofline = true
|
|||||||
vim.g.loaded_ruby_provider = 0
|
vim.g.loaded_ruby_provider = 0
|
||||||
vim.g.loaded_perl_provider = 0
|
vim.g.loaded_perl_provider = 0
|
||||||
|
|
||||||
|
local undodir = vim.fn.expand('~/.cache/nvim/undo')
|
||||||
|
vim.fn.mkdir(undodir, 'p')
|
||||||
|
vim.opt.undodir = undodir
|
||||||
|
vim.opt.undofile = true
|
||||||
|
|
||||||
vim.opt.conceallevel = 1
|
vim.opt.conceallevel = 1
|
||||||
|
|
||||||
vim.opt.shell = '/bin/bash'
|
vim.opt.shell = '/bin/bash'
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ map('t', '<ESC><ESC>', '<C-\\><C-n>', default_options)
|
|||||||
map('i', 'jj', '<ESC>', default_options)
|
map('i', 'jj', '<ESC>', default_options)
|
||||||
map('i', 'jk', '<ESC>', default_options)
|
map('i', 'jk', '<ESC>', default_options)
|
||||||
--map('i', ':w<CR>', '<Esc>:w<CR>', default_options)
|
--map('i', ':w<CR>', '<Esc>:w<CR>', default_options)
|
||||||
map('n', 'Q', '<cmd>q<CR>', default_options)
|
map('n', 'Q', '<cmd>q', default_options)
|
||||||
|
|
||||||
-- Reselect visual block after incrementing/decrementing
|
-- Reselect visual block after incrementing/decrementing
|
||||||
map('v', '<c-a>', '<c-a>gv', default_options)
|
map('v', '<c-a>', '<c-a>gv', default_options)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
return {
|
return {
|
||||||
'samodostal/image.nvim',
|
'samodostal/image.nvim',
|
||||||
|
name = 'ascii-image',
|
||||||
opts = {
|
opts = {
|
||||||
render = {
|
render = {
|
||||||
min_padding = 5,
|
min_padding = 5,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"wuelnerdotexe/vim-enfocado",
|
"wuelnerdotexe/vim-enfocado",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('enfocado')
|
--vim.cmd.colorscheme('enfocado')
|
||||||
end
|
end
|
||||||
@@ -16,6 +17,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"fenetikm/falcon",
|
"fenetikm/falcon",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('falcon')
|
--vim.cmd.colorscheme('falcon')
|
||||||
end
|
end
|
||||||
@@ -23,6 +25,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"casr/vim-colors-reference",
|
"casr/vim-colors-reference",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('reference')
|
--vim.cmd.colorscheme('reference')
|
||||||
end
|
end
|
||||||
@@ -30,6 +33,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"blazkowolf/gruber-darker.nvim",
|
"blazkowolf/gruber-darker.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('gruber-darker')
|
--vim.cmd.colorscheme('gruber-darker')
|
||||||
end
|
end
|
||||||
@@ -37,6 +41,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"rebelot/kanagawa.nvim",
|
"rebelot/kanagawa.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('kanagawa')
|
--vim.cmd.colorscheme('kanagawa')
|
||||||
end
|
end
|
||||||
@@ -44,6 +49,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"jaredgorski/spacecamp",
|
"jaredgorski/spacecamp",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('spacecamp')
|
--vim.cmd.colorscheme('spacecamp')
|
||||||
end
|
end
|
||||||
@@ -51,6 +57,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"lifepillar/vim-gruvbox8",
|
"lifepillar/vim-gruvbox8",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('gruvbox8')
|
--vim.cmd.colorscheme('gruvbox8')
|
||||||
end
|
end
|
||||||
@@ -58,6 +65,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"marko-cerovac/material.nvim",
|
"marko-cerovac/material.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('material')
|
--vim.cmd.colorscheme('material')
|
||||||
end
|
end
|
||||||
@@ -65,6 +73,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"srcery-colors/srcery-vim",
|
"srcery-colors/srcery-vim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('srcery')
|
--vim.cmd.colorscheme('srcery')
|
||||||
end
|
end
|
||||||
@@ -72,6 +81,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"tanvirtin/monokai.nvim",
|
"tanvirtin/monokai.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('monokai')
|
--vim.cmd.colorscheme('monokai')
|
||||||
end
|
end
|
||||||
@@ -79,13 +89,15 @@ return {{
|
|||||||
{
|
{
|
||||||
"dasupradyumna/midnight.nvim",
|
"dasupradyumna/midnight.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('midnight')
|
vim.cmd.colorscheme('midnight')
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"bluz71/vim-moonfly-colors",
|
"bluz71/vim-moonfly-colors",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('moonfly')
|
--vim.cmd.colorscheme('moonfly')
|
||||||
end
|
end
|
||||||
@@ -93,6 +105,7 @@ return {{
|
|||||||
{
|
{
|
||||||
"kuznetsss/meadow.nvim",
|
"kuznetsss/meadow.nvim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--require('meadow').setup()
|
--require('meadow').setup()
|
||||||
--vim.cmd.colorscheme('meadow')
|
--vim.cmd.colorscheme('meadow')
|
||||||
@@ -102,20 +115,28 @@ return {{
|
|||||||
{
|
{
|
||||||
"kepano/flexoki-neovim",
|
"kepano/flexoki-neovim",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
--vim.cmd.colorscheme('flexoki-dark')
|
--vim.cmd.colorscheme('flexoki-dark')
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"https://gitlab.com/bartekjaszczak/distinct-nvim",
|
"https://gitlab.com/bartekjaszczak/distinct-nvim",
|
||||||
|
lazy = false,
|
||||||
priority = 1000,
|
priority = 1000,
|
||||||
config = function()
|
config = function()
|
||||||
require("distinct").setup({
|
-- require("distinct").setup({
|
||||||
doc_comments_different_color = true, -- Use different colour for documentation comments
|
-- doc_comments_different_color = true, -- Use different colour for documentation comments
|
||||||
})
|
-- })
|
||||||
|
-- vim.cmd.colorscheme('distinct')
|
||||||
vim.cmd.colorscheme('distinct')
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'kevinm6/kurayami.nvim',
|
||||||
|
lazy = false,
|
||||||
|
priority = 1000,
|
||||||
|
config = function()
|
||||||
|
--vim.cmd.colorscheme('kurayami')
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ return {
|
|||||||
'AckslD/nvim-FeMaco.lua',
|
'AckslD/nvim-FeMaco.lua',
|
||||||
config = function()
|
config = function()
|
||||||
require('femaco').setup()
|
require('femaco').setup()
|
||||||
vim.keymap.set('n', '<leader>!', '<cmd>FeMaCo<cr>', { noremap = true, silent = true })
|
vim.keymap.set('n', '<leader>!', '<cmd>FeMaco<cr>', { noremap = true, silent = true })
|
||||||
end,
|
end,
|
||||||
|
cmd = { "FeMaco" },
|
||||||
|
keys = { "<leader>!" }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,18 +3,17 @@ return {
|
|||||||
'neovim/nvim-lspconfig',
|
'neovim/nvim-lspconfig',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
-- "SmiteshP/nvim-navbuddy",
|
-- "SmiteshP/nvim-navbuddy",
|
||||||
{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",
|
||||||
"artemave/workspace-diagnostics.nvim"
|
{url = "http://git.sr.ht/~p00f/clangd_extensions.nvim"},
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
require("neodev").setup({
|
require("neodev").setup({
|
||||||
library = { plugins = { "nvim-dap-ui" }, types = true },
|
library = { plugins = { "nvim-dap-ui" }, types = true },
|
||||||
})
|
})
|
||||||
local nvim_lsp = require('lspconfig')
|
local nvim_lsp = require('lspconfig')
|
||||||
local clangd_extensions = require('clangd_extensions').setup({
|
require('clangd_extensions').setup({
|
||||||
inlay_hints = {
|
inlay_hints = {
|
||||||
inline = false,
|
inline = false,
|
||||||
-- Options other than `highlight' and `priority' only work
|
-- Options other than `highlight' and `priority' only work
|
||||||
@@ -136,7 +135,6 @@ return {
|
|||||||
-- })
|
-- })
|
||||||
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()
|
||||||
--require("workspace-diagnostics").populate_workspace_diagnostics(ev.buf)
|
|
||||||
|
|
||||||
local signs = {
|
local signs = {
|
||||||
{ name = "DiagnosticSignError", text = "" },
|
{ name = "DiagnosticSignError", text = "" },
|
||||||
@@ -201,11 +199,6 @@ 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)
|
|
||||||
-- local client = vim.lsp.get_client_by_id(ctx.client_id)
|
|
||||||
-- return {client.config.settings.matlab}
|
|
||||||
-- end
|
|
||||||
-- },
|
|
||||||
root_dir = nvim_lsp.util.find_git_ancestor,
|
root_dir = nvim_lsp.util.find_git_ancestor,
|
||||||
single_file_support = true,
|
single_file_support = true,
|
||||||
settings = {
|
settings = {
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
return {
|
return {
|
||||||
'nvimtools/none-ls.nvim',
|
'nvimtools/none-ls.nvim',
|
||||||
config = function()
|
config = function()
|
||||||
null_ls = require("null-ls")
|
local none_ls = require("null-ls")
|
||||||
null_ls.setup({
|
none_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.formatting.stylua,
|
none_ls.builtins.code_actions.gitsigns,
|
||||||
--null_ls.builtins.completion.spell,
|
none_ls.builtins.diagnostics.gitlint,
|
||||||
null_ls.builtins.code_actions.gitsigns,
|
none_ls.builtins.diagnostics.cmake_lint,
|
||||||
null_ls.builtins.diagnostics.gitlint,
|
none_ls.builtins.diagnostics.codespell,
|
||||||
null_ls.builtins.diagnostics.cmake_lint,
|
none_ls.builtins.hover.dictionary,
|
||||||
null_ls.builtins.diagnostics.codespell,
|
none_ls.builtins.formatting.black},
|
||||||
--null_ls.builtins.diagnostics.misspell,
|
|
||||||
null_ls.builtins.diagnostics.hadolint,
|
|
||||||
null_ls.builtins.diagnostics.buf,
|
|
||||||
--null_ls.builtins.code_actions.proselint,
|
|
||||||
--null_ls.builtins.diagnostics.proselint,
|
|
||||||
null_ls.builtins.hover.dictionary,
|
|
||||||
null_ls.builtins.formatting.black},
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
return {
|
return {
|
||||||
|
{ 'tzachar/cmp-ai', dependencies = 'nvim-lua/plenary.nvim'},
|
||||||
|
{ 'petertriho/cmp-git'},
|
||||||
|
{
|
||||||
'hrsh7th/nvim-cmp',
|
'hrsh7th/nvim-cmp',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'dcampos/cmp-snippy',
|
'dcampos/cmp-snippy',
|
||||||
@@ -10,11 +13,71 @@ return {
|
|||||||
'hrsh7th/cmp-nvim-lsp-signature-help',
|
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
'hrsh7th/cmp-path',
|
'hrsh7th/cmp-path',
|
||||||
'hrsh7th/cmp-calc',
|
'hrsh7th/cmp-calc',
|
||||||
|
'tzachar/cmp-ai'
|
||||||
},
|
},
|
||||||
|
|
||||||
event = "InsertEnter",
|
event = "InsertEnter",
|
||||||
config = function()
|
config = function()
|
||||||
local cmp = require'cmp'
|
local cmp = require'cmp'
|
||||||
local snippy = require'snippy'
|
local snippy = require'snippy'
|
||||||
|
local cmp_ai = require('cmp_ai.config')
|
||||||
|
|
||||||
|
cmp_ai:setup({
|
||||||
|
max_lines = 100,
|
||||||
|
provider = 'Ollama',
|
||||||
|
provider_options = {
|
||||||
|
model = 'deepseek-coder:6.7b',
|
||||||
|
base_url = 'http://batman.local:11434/api/generate',
|
||||||
|
prompt = function(lines_before, lines_after)
|
||||||
|
-- prompt depends on the model you use. Here is an example for deepseek coder
|
||||||
|
return '<PRE> ' .. lines_before .. ' <SUF>' .. lines_after .. ' <MID>' -- for codellama
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
debounce_delay = 600, -- ms llama may be GPU hungry, wait x ms after last key input, before sending request to it
|
||||||
|
notify = true,
|
||||||
|
notify_callback = function(msg)
|
||||||
|
vim.notify(msg)
|
||||||
|
end,
|
||||||
|
run_on_every_keystroke = true,
|
||||||
|
ignored_file_types = {
|
||||||
|
-- default is not to ignore
|
||||||
|
-- uncomment to ignore in lua:
|
||||||
|
-- lua = true
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
local default_cmp_sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'snippy' },
|
||||||
|
{ name = 'calc' },
|
||||||
|
--{ name = 'cmp_git' },
|
||||||
|
--{ name = 'cmp_ai' },
|
||||||
|
})
|
||||||
|
|
||||||
|
local bufIsBig = function(bufnr)
|
||||||
|
local max_filesize = 100 * 1024 -- 100 KB
|
||||||
|
local ok, stats = vim.loop.fs_stat(vim.api.nvim_buf_get_name(bufnr))
|
||||||
|
if ok and stats and stats.size > max_filesize then
|
||||||
|
return true
|
||||||
|
else
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- If a file is too large, I don't want to add to it's cmp sources treesitter, see:
|
||||||
|
-- https://github.com/hrsh7th/nvim-cmp/issues/1522
|
||||||
|
vim.api.nvim_create_autocmd('BufReadPre', {
|
||||||
|
callback = function(t)
|
||||||
|
local sources = default_cmp_sources
|
||||||
|
if not bufIsBig(t.buf) then
|
||||||
|
sources[#sources+1] = {name = 'treesitter', group_index = 2}
|
||||||
|
end
|
||||||
|
cmp.setup.buffer {
|
||||||
|
sources = sources
|
||||||
|
}
|
||||||
|
end
|
||||||
|
})
|
||||||
|
|
||||||
cmp.setup({
|
cmp.setup({
|
||||||
snippet = {
|
snippet = {
|
||||||
@@ -48,8 +111,10 @@ return {
|
|||||||
}, {
|
}, {
|
||||||
{ name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
|
{ name = 'buffer', keyword_length = 5, max_item_count = 10, priority = -5 },
|
||||||
}),
|
}),
|
||||||
|
sources = sources,
|
||||||
sorting = {
|
sorting = {
|
||||||
comparators = {
|
comparators = {
|
||||||
|
require('cmp_ai.compare'),
|
||||||
cmp.config.compare.offset,
|
cmp.config.compare.offset,
|
||||||
cmp.config.compare.exact,
|
cmp.config.compare.exact,
|
||||||
cmp.config.compare.recently_used,
|
cmp.config.compare.recently_used,
|
||||||
@@ -89,3 +154,4 @@ return {
|
|||||||
require("cmp_git").setup()
|
require("cmp_git").setup()
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -68,24 +68,24 @@ return {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
local keymap = vim.api.nvim_set_keymap
|
-- local keymap = vim.api.nvim_set_keymap
|
||||||
local opts = {noremap = true, silent = true}
|
-- local opts = {noremap = true, silent = true}
|
||||||
|
--
|
||||||
keymap("n", "<LEADER>plf", ":PerfLoadFlat<CR>", opts)
|
-- keymap("n", "<LEADER>plf", ":PerfLoadFlat<CR>", opts)
|
||||||
keymap("n", "<LEADER>plg", ":PerfLoadCallGraph<CR>", opts)
|
-- keymap("n", "<LEADER>plg", ":PerfLoadCallGraph<CR>", opts)
|
||||||
keymap("n", "<LEADER>plo", ":PerfLoadFlameGraph<CR>", opts)
|
-- keymap("n", "<LEADER>plo", ":PerfLoadFlameGraph<CR>", opts)
|
||||||
|
--
|
||||||
keymap("n", "<LEADER>pe", ":PerfPickEvent<CR>", opts)
|
-- keymap("n", "<LEADER>pe", ":PerfPickEvent<CR>", opts)
|
||||||
|
--
|
||||||
keymap("n", "<LEADER>pa", ":PerfAnnotate<CR>", opts)
|
-- keymap("n", "<LEADER>pa", ":PerfAnnotate<CR>", opts)
|
||||||
keymap("n", "<LEADER>pf", ":PerfAnnotateFunction<CR>", opts)
|
-- keymap("n", "<LEADER>pf", ":PerfAnnotateFunction<CR>", opts)
|
||||||
keymap("v", "<LEADER>pa", ":PerfAnnotateSelection<CR>", opts)
|
-- keymap("v", "<LEADER>pa", ":PerfAnnotateSelection<CR>", opts)
|
||||||
|
--
|
||||||
keymap("n", "<LEADER>pt", ":PerfToggleAnnotations<CR>", opts)
|
-- keymap("n", "<LEADER>pt", ":PerfToggleAnnotations<CR>", opts)
|
||||||
|
--
|
||||||
keymap("n", "<LEADER>ph", ":PerfHottestLines<CR>", opts)
|
-- keymap("n", "<LEADER>ph", ":PerfHottestLines<CR>", opts)
|
||||||
keymap("n", "<LEADER>ps", ":PerfHottestSymbols<CR>", opts)
|
-- keymap("n", "<LEADER>ps", ":PerfHottestSymbols<CR>", opts)
|
||||||
keymap("n", "<LEADER>pc", ":PerfHottestCallersFunction<CR>", opts)
|
-- keymap("n", "<LEADER>pc", ":PerfHottestCallersFunction<CR>", opts)
|
||||||
keymap("v", "<LEADER>pc", ":PerfHottestCallersSelection<CR>", opts)
|
-- keymap("v", "<LEADER>pc", ":PerfHottestCallersSelection<CR>", opts)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,16 @@
|
|||||||
return {
|
return {
|
||||||
'hedyhli/outline.nvim',
|
'stevearc/aerial.nvim',
|
||||||
config = true,
|
config = function()
|
||||||
cmd = { 'OutlineOpen' }
|
require("aerial").setup({
|
||||||
|
-- optionally use on_attach to set keymaps when aerial has attached to a buffer
|
||||||
|
on_attach = function(bufnr)
|
||||||
|
-- Jump forwards/backwards with '{' and '}'
|
||||||
|
vim.keymap.set("n", "{", "<cmd>AerialPrev<CR>", { buffer = bufnr })
|
||||||
|
vim.keymap.set("n", "}", "<cmd>AerialNext<CR>", { buffer = bufnr })
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- You probably also want to set a keymap to toggle aerial
|
||||||
|
--vim.keymap.set("n", "<leader>a", "<cmd>AerialToggle!<CR>")
|
||||||
|
end,
|
||||||
|
cmd = { 'AerialToggle' }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
return {
|
return {
|
||||||
"wellle/targets.vim",
|
"tpope/vim-surround",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,12 @@ return {
|
|||||||
'debugloop/telescope-undo.nvim',
|
'debugloop/telescope-undo.nvim',
|
||||||
'molecule-man/telescope-menufacture',
|
'molecule-man/telescope-menufacture',
|
||||||
'xiyaowong/telescope-emoji.nvim',
|
'xiyaowong/telescope-emoji.nvim',
|
||||||
|
{
|
||||||
|
{
|
||||||
|
"isak102/telescope-git-file-history.nvim",
|
||||||
|
dependencies = { "tpope/vim-fugitive" }
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
event = 'VeryLazy',
|
event = 'VeryLazy',
|
||||||
--cmd = ":Telescope",
|
--cmd = ":Telescope",
|
||||||
@@ -33,6 +39,7 @@ 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")
|
||||||
|
require("telescope").load_extension("git_file_history")
|
||||||
local def = { noremap = true, silent = true }
|
local def = { noremap = true, silent = true }
|
||||||
local map = vim.keymap.set
|
local map = vim.keymap.set
|
||||||
map('n', '<leader>r', '<cmd>lua require("telescope.builtin").resume()<cr>', def)
|
map('n', '<leader>r', '<cmd>lua require("telescope.builtin").resume()<cr>', def)
|
||||||
@@ -52,6 +59,7 @@ return {
|
|||||||
-- map('n', '<leader>gc', '<cmd>lua require("telescope.builtin").git_commits()<cr>', def)
|
-- 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>gC', '<cmd>lua require("telescope.builtin").git_bcommits()<cr>', def)
|
||||||
-- map('n', '<leader>gb', '<cmd>lua require("telescope.builtin").git_branches()<cr>', def)
|
-- map('n', '<leader>gb', '<cmd>lua require("telescope.builtin").git_branches()<cr>', def)
|
||||||
|
-- map('n', '<leader>gb', '<cmd>lua require("telescope.builtin").git_branches()<cr>', def)
|
||||||
-- other
|
-- other
|
||||||
-- map('n', '<leader>s', '<cmd>lua require('telescope').extensions.ultisnips.ultisnips()<cr>, def)
|
-- 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)
|
map('n', '<leader>u', '<cmd>lua require("telescope").extensions.undo.undo()<cr>', def)
|
||||||
|
|||||||
@@ -10,13 +10,17 @@ return {
|
|||||||
config = function()
|
config = function()
|
||||||
-- Tree-sitter configuration
|
-- Tree-sitter configuration
|
||||||
|
|
||||||
ts = require'nvim-treesitter.configs'
|
local ts = require'nvim-treesitter.configs'
|
||||||
|
|
||||||
ts.setup {
|
ts.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
disable = function(lang, buf)
|
disable = function(lang, buf)
|
||||||
return vim.api.nvim_buf_line_count(buf) > 5000
|
local max_filesize = 100 * 1024
|
||||||
|
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,
|
||||||
},
|
},
|
||||||
@@ -60,10 +64,9 @@ return {
|
|||||||
"vim",
|
"vim",
|
||||||
"yaml",
|
"yaml",
|
||||||
},
|
},
|
||||||
-- disabled, since it mostly shifts to four characters
|
indent = {
|
||||||
--indent = {
|
enable = true,
|
||||||
-- enable = true,
|
},
|
||||||
--},
|
|
||||||
incremental_selection = {
|
incremental_selection = {
|
||||||
enable = true,
|
enable = true,
|
||||||
keymaps = {
|
keymaps = {
|
||||||
@@ -79,7 +82,7 @@ return {
|
|||||||
include_match_words
|
include_match_words
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
-- vim.opt.foldmethod = "expr"
|
vim.opt.foldmethod = "expr"
|
||||||
-- vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
return {
|
return {
|
||||||
'artemave/workspace-diagnostics.nvim',
|
'folke/trouble.nvim',
|
||||||
config = true,
|
config = true,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,17 +18,125 @@ return {
|
|||||||
|
|
||||||
require("cmake-tools").setup {
|
require("cmake-tools").setup {
|
||||||
cmake_command = "cmake",
|
cmake_command = "cmake",
|
||||||
|
ctest_command = "ctest",
|
||||||
|
cmake_generate_options = { "-DCMAKE_EXPORT_COMPILE_COMMANDS=1" },
|
||||||
|
cmake_build_options = { "-j 15" },
|
||||||
cmake_build_directory = "build",
|
cmake_build_directory = "build",
|
||||||
cmake_generate_options = { "-D", "CMAKE_EXPORT_COMPILE_COMMANDS=1" },
|
cmake_soft_link_compile_commands = true, -- this will automatically make a soft link from compile commands file to project root dir
|
||||||
cmake_build_options = {},
|
cmake_compile_commands_from_lsp = false, -- this will automatically set compile commands file location using lsp, to use it, please set `cmake_soft_link_compile_commands` to false
|
||||||
cmake_console_size = 10, -- cmake output window height
|
cmake_kits_path = nil, -- this is used to specify global cmake kits path, see CMakeKits for detailed usage
|
||||||
cmake_show_console = "always", -- "always", "only_on_error"
|
|
||||||
cmake_dap_configuration = { name = "cpp", type = "codelldb", request = "launch" }, -- dap configuration, optional
|
|
||||||
--cmake_dap_open_command = require("dap").repl.open, -- optional
|
|
||||||
cmake_variants_message = {
|
cmake_variants_message = {
|
||||||
short = { show = true },
|
short = { show = true }, -- whether to show short message
|
||||||
long = { show = true, max_length = 40 }
|
long = { show = true, max_length = 40 }, -- whether to show long message
|
||||||
|
},
|
||||||
|
cmake_dap_configuration = { -- debug settings for cmake
|
||||||
|
name = "cmake_tools",
|
||||||
|
type = "gdb",
|
||||||
|
request = "launch",
|
||||||
|
stopOnEntry = false,
|
||||||
|
runInTerminal = true,
|
||||||
|
console = "integratedTerminal",
|
||||||
|
},
|
||||||
|
cmake_executor = { -- executor to use
|
||||||
|
name = "toggleterm", -- name of the executor
|
||||||
|
opts = {}, -- the options the executor will get, possible values depend on the executor type. See `default_opts` for possible values.
|
||||||
|
default_opts = { -- a list of default and possible values for executors
|
||||||
|
quickfix = {
|
||||||
|
show = "always", -- "always", "only_on_error"
|
||||||
|
position = "belowright", -- "vertical", "horizontal", "leftabove", "aboveleft", "rightbelow", "belowright", "topleft", "botright", use `:h vertical` for example to see help on them
|
||||||
|
size = 10,
|
||||||
|
encoding = "utf-8", -- if encoding is not "utf-8", it will be converted to "utf-8" using `vim.fn.iconv`
|
||||||
|
auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
|
||||||
|
},
|
||||||
|
toggleterm = {
|
||||||
|
direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float'
|
||||||
|
close_on_exit = false, -- whether close the terminal when exit
|
||||||
|
auto_scroll = true, -- whether auto scroll to the bottom
|
||||||
|
},
|
||||||
|
overseer = {
|
||||||
|
new_task_opts = {
|
||||||
|
strategy = {
|
||||||
|
"toggleterm",
|
||||||
|
direction = "horizontal",
|
||||||
|
autos_croll = true,
|
||||||
|
quit_on_exit = "success"
|
||||||
}
|
}
|
||||||
|
}, -- options to pass into the `overseer.new_task` command
|
||||||
|
on_new_task = function(task)
|
||||||
|
require("overseer").open(
|
||||||
|
{ enter = false, direction = "right" }
|
||||||
|
)
|
||||||
|
end, -- a function that gets overseer.Task when it is created, before calling `task:start`
|
||||||
|
},
|
||||||
|
terminal = {
|
||||||
|
name = "Main Terminal",
|
||||||
|
prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
|
||||||
|
split_direction = "horizontal", -- "horizontal", "vertical"
|
||||||
|
split_size = 11,
|
||||||
|
|
||||||
|
-- Window handling
|
||||||
|
single_terminal_per_instance = true, -- Single viewport, multiple windows
|
||||||
|
single_terminal_per_tab = true, -- Single viewport per tab
|
||||||
|
keep_terminal_static_location = true, -- Static location of the viewport if available
|
||||||
|
|
||||||
|
-- Running Tasks
|
||||||
|
start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
|
||||||
|
focus = false, -- Focus on terminal when cmake task is launched.
|
||||||
|
do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter.
|
||||||
|
}, -- terminal executor uses the values in cmake_terminal
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cmake_runner = { -- runner to use
|
||||||
|
name = "toggleterm", -- name of the runner
|
||||||
|
opts = {}, -- the options the runner will get, possible values depend on the runner type. See `default_opts` for possible values.
|
||||||
|
default_opts = { -- a list of default and possible values for runners
|
||||||
|
quickfix = {
|
||||||
|
show = "always", -- "always", "only_on_error"
|
||||||
|
position = "belowright", -- "bottom", "top"
|
||||||
|
size = 10,
|
||||||
|
encoding = "utf-8",
|
||||||
|
auto_close_when_success = true, -- typically, you can use it with the "always" option; it will auto-close the quickfix buffer if the execution is successful.
|
||||||
|
},
|
||||||
|
toggleterm = {
|
||||||
|
direction = "float", -- 'vertical' | 'horizontal' | 'tab' | 'float'
|
||||||
|
close_on_exit = false, -- whether close the terminal when exit
|
||||||
|
auto_scroll = true, -- whether auto scroll to the bottom
|
||||||
|
},
|
||||||
|
overseer = {
|
||||||
|
new_task_opts = {
|
||||||
|
strategy = {
|
||||||
|
"toggleterm",
|
||||||
|
direction = "horizontal",
|
||||||
|
autos_croll = true,
|
||||||
|
quit_on_exit = "success"
|
||||||
}
|
}
|
||||||
|
}, -- options to pass into the `overseer.new_task` command
|
||||||
|
on_new_task = function(task)
|
||||||
|
end, -- a function that gets overseer.Task when it is created, before calling `task:start`
|
||||||
|
},
|
||||||
|
terminal = {
|
||||||
|
name = "Main Terminal",
|
||||||
|
prefix_name = "[CMakeTools]: ", -- This must be included and must be unique, otherwise the terminals will not work. Do not use a simple spacebar " ", or any generic name
|
||||||
|
split_direction = "horizontal", -- "horizontal", "vertical"
|
||||||
|
split_size = 11,
|
||||||
|
|
||||||
|
-- Window handling
|
||||||
|
single_terminal_per_instance = true, -- Single viewport, multiple windows
|
||||||
|
single_terminal_per_tab = true, -- Single viewport per tab
|
||||||
|
keep_terminal_static_location = true, -- Static location of the viewport if available
|
||||||
|
|
||||||
|
-- Running Tasks
|
||||||
|
start_insert = false, -- If you want to enter terminal with :startinsert upon using :CMakeRun
|
||||||
|
focus = false, -- Focus on terminal when cmake task is launched.
|
||||||
|
do_not_add_newline = false, -- Do not hit enter on the command inserted when using :CMakeRun, allowing a chance to review or modify the command before hitting enter.
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
cmake_notifications = {
|
||||||
|
runner = { enabled = true },
|
||||||
|
executor = { enabled = true },
|
||||||
|
spinner = { "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" }, -- icons used for progress display
|
||||||
|
refresh_rate_ms = 100, -- how often to iterate icons
|
||||||
|
}, }
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user