Compare commits
242 Commits
Author | SHA1 | Date | |
---|---|---|---|
80e3c762f5 | |||
44376422e0 | |||
851238e0b9 | |||
a5b0466f17 | |||
eb87655ced | |||
99008719e2 | |||
f77d8674be | |||
3dfbd9b8b6 | |||
62ffea7b57 | |||
148a870385 | |||
9207bbe62a | |||
d1900be2af | |||
c72644682d | |||
4665a3b753 | |||
5819910aee | |||
df73cb06c6 | |||
fcd0795561 | |||
6879b11ffa | |||
2ed815894f | |||
476c83e7a8 | |||
90494dfad6 | |||
6b020335df | |||
5f17610dbf | |||
5542c5b564 | |||
bbdfe3d6e8 | |||
903112b0bb | |||
a11811019c | |||
8b373ff24f | |||
03e2166f57 | |||
8bd2e43052 | |||
e725e4deee | |||
f5f903620f | |||
7c8bf66b37 | |||
e8f5e62439 | |||
a94b098588 | |||
4ee5f69566 | |||
a0086b4380 | |||
0139368180 | |||
63ff84fae1 | |||
1e15ac6637 | |||
170aa9c79f | |||
56357acccf | |||
506583b78a | |||
04c9200050 | |||
9e8d143b24 | |||
849cb2a2c7 | |||
3324cb1fff | |||
ebefdb64ff | |||
3e49aa40a5 | |||
6e3a2f931c | |||
4240bd1bde | |||
8f6caa96e5 | |||
97c469b1ef | |||
70a06005fe | |||
dcf6d687b8 | |||
eca6376d79 | |||
33e497133c | |||
bc278c2a62 | |||
99690477af | |||
5b4001d7e8 | |||
02aa672af8 | |||
480b9c5db1 | |||
91faa6b627 | |||
2670f4f656 | |||
7a2c6ecd29 | |||
656ff601a3 | |||
2b592e82ad | |||
a15e7cba84 | |||
d62c914ea5 | |||
1792e54500 | |||
b9cf3aadef | |||
b87bbaee74 | |||
fa0d4ffd8f | |||
c60cf314be | |||
2b0d14d7a1 | |||
7bdf105fac | |||
045a1af8dc | |||
c911f288c6 | |||
c81d9e0bda | |||
561b99ac1b | |||
cfa7b243f3 | |||
6c51bce00d | |||
a7a4319243 | |||
4565a3aabd | |||
413a11e741 | |||
b4e5f2b7b4 | |||
70d6dbda37 | |||
100b358acb | |||
c5e740a70b | |||
7f00267ec8 | |||
9e8672038e | |||
4f5bd49e70 | |||
7d318b2512 | |||
beba8b3c51 | |||
e2c55680ee | |||
a5ceececb5 | |||
ec07710b24 | |||
b9c4ea5413 | |||
520858f6ac | |||
2b48e24a28 | |||
ee1033a856 | |||
1983373ba0 | |||
f2f51655a0 | |||
8de574df32 | |||
ed78b61632 | |||
35552af831 | |||
874cb95f01 | |||
2d3f05b6be | |||
06b46caf29 | |||
42fb43f54b | |||
b35136bae4 | |||
5a1a8e8f3e | |||
78cbde972f | |||
e3c8a5ddd4 | |||
c8e1906f22 | |||
4aa3048e23 | |||
3a70a67737 | |||
2c57a134e3 | |||
0c5f81d6d4 | |||
54e87b448e | |||
1e7fd727c2 | |||
b6e811ab23 | |||
98d3f5cac7 | |||
b0918760d4 | |||
9055e4e876 | |||
4916c4eca2 | |||
ce61facff9 | |||
fd16ef223a | |||
5dd99d7085 | |||
9361934d8a | |||
4f0bab54b5 | |||
e562f3b996 | |||
17b3f53e11 | |||
c136b87b7b | |||
1adb3c8ff2 | |||
b7167a3a47 | |||
62734cac5c | |||
fa41d32ae1 | |||
c52f6304d4 | |||
e1e32cf52c | |||
a62b9ca215 | |||
6b9089ee85 | |||
8fb7e9ad0a | |||
738bcabefe | |||
dc534b5a38 | |||
51183ffd55 | |||
58ae25ee12 | |||
1d9f94e650 | |||
5d7231efa2 | |||
1d436a3df7 | |||
b91b0b48b4 | |||
15f8c3ecf7 | |||
d7705f1dec | |||
74c87cee88 | |||
8fa2f0f0e1 | |||
49edb9e202 | |||
2d5f71805e | |||
45ea60d689 | |||
186052c31a | |||
11b954ff33 | |||
bce0373dfb | |||
e111deabc9 | |||
c5073fe73e | |||
62a276a336 | |||
a188cf2c9f | |||
64f65a1d57 | |||
814ebfa3ce | |||
cdd13eeccc | |||
f638d730ad | |||
c0dc96fd9d | |||
3546f84367 | |||
8ef35063dd | |||
0fcdf98cf3 | |||
78544dcdbf | |||
d8dee9c878 | |||
fa5c5f32a4 | |||
4c3fce3ba2 | |||
8f26b25bef | |||
e93e47bd69 | |||
2ff32c06fd | |||
fb5373f0a7 | |||
0b17bf0cfb | |||
11140c602e | |||
c8f9050caf | |||
51eab5c6ea | |||
9c86c2a32e | |||
9b8097dc36 | |||
15b03ee11f | |||
4b3bc84837 | |||
861b60e4f7 | |||
ff7a190162 | |||
a2f360ddb4 | |||
66477e10a0 | |||
c8bbbe4057 | |||
f7536e94ae | |||
a09b75f16e | |||
56797a2564 | |||
a64aeb9dd6 | |||
350d42333a | |||
45f61cf7fe | |||
4b532e698f | |||
9fc33c2b44 | |||
474fe4cb44 | |||
ea267d690f | |||
c23240ab03 | |||
8c672f19db | |||
476205ce47 | |||
837a273774 | |||
3d0b66c7ab | |||
0dfcf42beb | |||
8ea3ed7a79 | |||
518f32d3bb | |||
db1ad041ab | |||
76249b2a8a | |||
e2460a2425 | |||
5b6ae54763 | |||
3272e4067f | |||
1e8201cd13 | |||
7629d6d57e | |||
d0c31ea3b7 | |||
570b9fe329 | |||
739b2154eb | |||
edc73d3639 | |||
d91ae17970 | |||
f9d34430ae | |||
74e6cc3bb4 | |||
7e31d668ee | |||
4bbf17633d | |||
a7a5a41f8d | |||
a3942972d8 | |||
ea6e95aca8 | |||
67067bde77 | |||
d3e3bbc903 | |||
dbfd744f97 | |||
b4d08255a5 | |||
827adacc68 | |||
89b1d53451 | |||
4ba64948eb | |||
48acab5f4b | |||
0115553f37 | |||
a85b634110 | |||
a24b928433 |
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,3 +6,5 @@ plugged
|
||||
rplugin.vim
|
||||
plugin/packer_compiled.lua
|
||||
venv_debugpy
|
||||
.luarc.json
|
||||
.luarc.json
|
||||
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
|
||||
"Lua.diagnostics.disable": ["undefined-global"]
|
||||
}
|
||||
|
11
init.lua
11
init.lua
@ -1,4 +1,7 @@
|
||||
require('my_plugins')
|
||||
require('my_keymappings')
|
||||
require('my_options')
|
||||
require('my_autocommands')
|
||||
vim.g.mapleader = ','
|
||||
if not vim.g.vscode then
|
||||
require('config.lazy')
|
||||
require('my_keymappings')
|
||||
require('my_autocommands')
|
||||
require('config.options')
|
||||
end
|
||||
|
73
lazy-lock.json
Normal file
73
lazy-lock.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "e1fe53117aab24c378d5e6deaad786789c360123" },
|
||||
"FixCursorHold.nvim": { "branch": "master", "commit": "1900f89dc17c603eec29960f57c00bd9ae696495" },
|
||||
"LuaSnip": { "branch": "master", "commit": "b4bc24c4925aeb05fd47d2ee9b24b7f73f5d7e32" },
|
||||
"advanced-git-search.nvim": { "branch": "main", "commit": "5637d80861e253a8621450eb58621009e1307deb" },
|
||||
"aerial.nvim": { "branch": "master", "commit": "d8f2699f7ae0e5eb62424d7b2ad80ce30179ee92" },
|
||||
"clangd_extensions.nvim": { "branch": "main", "commit": "798e377ec859087132b81d2f347b5080580bd6b1" },
|
||||
"cmake-tools.nvim": { "branch": "master", "commit": "b279bfb861666563399de3599c24040b53a42fd2" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||
"cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "5af1bb7d722ef8a96658f01d6eb219c4cf746b32" },
|
||||
"cmp-cmdline-history": { "branch": "master", "commit": "003573b72d4635ce636234a826fa8c4ba2895ffe" },
|
||||
"cmp-dap": { "branch": "master", "commit": "d16f14a210cd28988b97ca8339d504533b7e09a4" },
|
||||
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
|
||||
"cmp-look": { "branch": "master", "commit": "b39c50bcdf6199dddda56adc466c2bd9c951a960" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
|
||||
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
|
||||
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||
"cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" },
|
||||
"cmp-treesitter": { "branch": "master", "commit": "389eadd48c27aa6dc0e6b992644704f026802a2e" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "1d6ea6ced1c3ec0f6464761a138bb35afd79ef63" },
|
||||
"dressing.nvim": { "branch": "master", "commit": "66e4990240f92e31b0d5e4df6deb6bb0160ae832" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "1d0dac346de7c6895ac72528df3276386c6b149b" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "814158f6c4b1724c039fcefe79b0be72c9131c2d" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "df149bccb19a02c5c2b9fa6ec0716f0c0487feb0" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "018bd04d80c9a73d399c1061fa0c3b14a7614399" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "aba872ec78ffe7f7367764ab0fff6f0170421fde" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "32bffdebe273e571588f25c8a708ca7297928617" },
|
||||
"leap.nvim": { "branch": "main", "commit": "6f2912755c9c4ae790abd829f0cf1b07c037b2a4" },
|
||||
"lsp_lines.nvim": { "branch": "main", "commit": "f53af96d4789eef39a082dbcce078d2bfc384ece" },
|
||||
"lsp_signature.nvim": { "branch": "master", "commit": "7a26ebaa7e36aa2aefa6c1994b2b866c96de32e6" },
|
||||
"lspkind-nvim": { "branch": "master", "commit": "57610d5ab560c073c465d6faf0c19f200cb67e6e" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "05d78e9fd0cdfb4545974a5aa14b1be95a86e9c9" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "90a8bbf106b85b76951a34c542058ffa807de2b1" },
|
||||
"mason.nvim": { "branch": "main", "commit": "e634134312bb936f472468a401c9cae6485ab54b" },
|
||||
"neo-tree.nvim": { "branch": "v2.x", "commit": "e5594d53986b34e584e8afe2ea6ad99d6f6d2105" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "5e7e613950df5e2be27534ab5c55fd21af1b2ad3" },
|
||||
"neogen": { "branch": "main", "commit": "c0fd3dc9e7cc91181ea5a345c4b01c865626c81e" },
|
||||
"neotest": { "branch": "master", "commit": "42cf226457c61abe6fca081e959d69e2325cf08f" },
|
||||
"neotest-python": { "branch": "master", "commit": "6c06041cfb45f45e276068020baa06c06fe20d5c" },
|
||||
"nui.nvim": { "branch": "main", "commit": "698e75814cd7c56b0dd8af4936bcef2d13807f3c" },
|
||||
"null-ls.nvim": { "branch": "main", "commit": "08bb00c7c2cd58c72e02cf54e4b9cbfe14b03e09" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "7747bbae60074acf0b9e3a4c13950be7a2dff444" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "d153771162bd9795d9f7142df5c674b61066a585" },
|
||||
"nvim-colorizer.lua": { "branch": "master", "commit": "dde3084106a70b9a79d48f426f6d6fec6fd203f7" },
|
||||
"nvim-dap": { "branch": "master", "commit": "6cedcb527e264c8f25e86afa8dae74c6692dee51" },
|
||||
"nvim-dap-python": { "branch": "master", "commit": "51ecb08dbff57fca8add396b93dc765aba262e0a" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "4ce7b97dd8f50b4f672948a34bf8f3a56214fdb8" },
|
||||
"nvim-dap-virtual-text": { "branch": "master", "commit": "ab988dbb7d20cdaebf9b3ef7554a89f6895de042" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "df58d91c9351a9dc5be6cf8d54f49ab0d9a64e73" },
|
||||
"nvim-neoclip.lua": { "branch": "main", "commit": "8094648c54ff3b233ccfe5928f77b6824f77339c" },
|
||||
"nvim-rooter.lua": { "branch": "main", "commit": "99832f243426a28c1cc0b83ee4cdf915bf0b2c2b" },
|
||||
"nvim-surround": { "branch": "main", "commit": "e6047128e57c1aff1566fb9f627521d2887fc77a" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "f2778bd1a28b74adf5b1aa51aa57da85adfa3d16" },
|
||||
"nvim-ts-rainbow": { "branch": "master", "commit": "ef95c15a935f97c65a80e48e12fe72d49aacf9b9" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "e283ab937e0197b37ec5d8013e49495193407324" },
|
||||
"octo.nvim": { "branch": "master", "commit": "1c9a79412a1d92dd3c5a601e2261c158ebb4d4bd" },
|
||||
"oil.nvim": { "branch": "master", "commit": "d27bfa1f370e8caddf65890364989b76f9794afb" },
|
||||
"overseer.nvim": { "branch": "master", "commit": "9e7cc435c1c85d37aa5471d7429501690f4d64d6" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "9ac3e9541bbabd9d73663d757e4fe48a675bb054" },
|
||||
"sqlite.lua": { "branch": "master", "commit": "b7e28c8463254c46a8e61c52d27d6a2040492fc3" },
|
||||
"telescope-dap.nvim": { "branch": "master", "commit": "313d2ea12ae59a1ca51b62bf01fc941a983d9c9c" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "580b6c48651cabb63455e97d7e131ed557b8c7e2" },
|
||||
"telescope-menufacture": { "branch": "main", "commit": "284eae0c6430a67ad5d24676e791749d31bd6bdf" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "62ea5e58c7bbe191297b983a9e7e89420f581369" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "ebf93395e79e5d026e3867d9e5e158b2bbe1499c" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "68fdf851c2b7901a7065ff129b77d3483419ddce" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "5f0d280b517cacb16f59316659966c7ca5e2bea2" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "5a6c954a5a46023c19acc03a8b6d7c3e57964fc5" }
|
||||
}
|
14
lua/config/lazy.lua
Normal file
14
lua/config/lazy.lua
Normal file
@ -0,0 +1,14 @@
|
||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'--single-branch',
|
||||
'https://github.com/folke/lazy.nvim.git',
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
vim.opt.runtimepath:prepend(lazypath)
|
||||
|
||||
require('lazy').setup('plugins', {})
|
@ -14,7 +14,6 @@ opt.ignorecase = true --Case insensitive searching unless /C or capital in searc
|
||||
opt.smartcase = true -- Smart case
|
||||
opt.updatetime = 300 --Decrease update time
|
||||
opt.signcolumn = 'yes' -- Always show sign column
|
||||
opt.clipboard = 'unnamed,unnamedplus' -- Access system clipboard
|
||||
opt.timeoutlen = 300 -- Time in milliseconds to wait for a mapped sequence to complete.
|
||||
opt.ttimeoutlen = 10
|
||||
opt.showmode = false -- Do not need to show the mode. We use the statusline instead.
|
||||
@ -23,30 +22,46 @@ opt.joinspaces = false -- No double spaces with join after a dot
|
||||
opt.showmatch = true -- Show matching braces
|
||||
opt.wrap = true -- When on, lines longer than the width of the window will wrap and displaying continues on the next line
|
||||
opt.list = true
|
||||
opt.hidden= true
|
||||
opt.scrolloff= 4
|
||||
opt.shiftround= true
|
||||
opt.relativenumber= false
|
||||
opt.splitbelow= true
|
||||
opt.splitright= true
|
||||
opt.wildmode= 'longest:full,full'
|
||||
opt.splitbelow= true
|
||||
opt.splitright= true
|
||||
opt.hidden = true
|
||||
opt.scrolloff = 4
|
||||
opt.shiftround = true
|
||||
opt.relativenumber = false
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.wildmode = 'longest:full,full'
|
||||
opt.splitbelow = true
|
||||
opt.splitright = true
|
||||
opt.shiftwidth = indent
|
||||
opt.tabstop = indent
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
opt.guifont= 'JetBrainsMono Nerd Font Mono:h7'
|
||||
if vim.fn.has('wsl') == 1 then
|
||||
vim.g.clipboard = {
|
||||
name = 'WslClipboard',
|
||||
copy = {
|
||||
['+'] = 'clip.exe',
|
||||
['*'] = 'clip.exe',
|
||||
},
|
||||
paste = {
|
||||
['+'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||
['*'] = 'powershell.exe -c [Console]::Out.Write($(Get-Clipboard -Raw).tostring().replace("`r", ""))',
|
||||
},
|
||||
cache_enabled = 0,
|
||||
}
|
||||
opt.guifont = 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
||||
|
||||
elseif vim.loop.os_uname().sysname == 'Linux' then
|
||||
opt.guifont = 'JetBrainsMono Nerd Font Mono:h7'
|
||||
else
|
||||
opt.guifont= 'JetBrainsMonoNL NF:h9' -- https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/JetBrainsMono/NoLigatures/Regular/complete/JetBrains%20Mono%20NL%20Regular%20Nerd%20Font%20Complete%20Mono%20Windows%20Compatible.ttf
|
||||
opt.guifont = 'Hack Nerd Font Mono:h10'
|
||||
end
|
||||
opt.swapfile= false
|
||||
opt.backup= false
|
||||
opt.spelllang= 'en,de'
|
||||
opt.completeopt= 'menu,menuone,noselect'
|
||||
opt.expandtab= true
|
||||
opt.smartindent= true
|
||||
opt.swapfile = false
|
||||
opt.backup = false
|
||||
opt.spelllang = 'en,de'
|
||||
opt.completeopt = 'menu,menuone,noselect'
|
||||
opt.expandtab = true
|
||||
opt.smartindent = true
|
||||
opt.title = true
|
||||
opt.titlestring = '%{getcwd()} - %t'
|
||||
opt.titlestring='%(%{fnamemodify(getcwd(),\":t\")}%) Neovim'
|
||||
opt.laststatus = 3 -- for lualine
|
||||
|
||||
-- go to previous/next line with h,l,left arrow and right arrow
|
||||
-- when cursor reaches end/beginning of line
|
||||
@ -59,4 +74,7 @@ opt.shortmess:append('sI')
|
||||
opt.foldlevel = 20
|
||||
opt.foldmethod = 'expr'
|
||||
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
||||
-- Window border for floating windows
|
||||
require('lspconfig.ui.windows').default_options.border = 'rounded'
|
@ -38,14 +38,14 @@ api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||
group = fileGrp,
|
||||
})
|
||||
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||
pattern = { 'doskey'},
|
||||
pattern = { 'doskey' },
|
||||
callback = function()
|
||||
vim.bo.filetype = 'dosini'
|
||||
end,
|
||||
group = fileGrp,
|
||||
})
|
||||
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||
pattern = { '.clangd', '.clang-tidy'},
|
||||
pattern = { '.clangd', '.clang-tidy' },
|
||||
callback = function()
|
||||
vim.bo.filetype = 'yaml'
|
||||
end,
|
||||
@ -54,7 +54,6 @@ api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
|
||||
|
||||
-- Read and write shada file
|
||||
api.nvim_create_autocmd({ 'FocusLost' }, { command = [[wshada]] })
|
||||
api.nvim_create_autocmd({ 'FocusGained' }, { command = [[rshada]] })
|
||||
|
||||
-- go to last loc when opening a buffer
|
||||
-- api.nvim_create_autocmd(
|
||||
@ -63,7 +62,8 @@ api.nvim_create_autocmd({ 'FocusGained' }, { command = [[rshada]] })
|
||||
-- )
|
||||
|
||||
-- Check if we need to reload the file when it changed
|
||||
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' }, { command = [[if !bufexists("[Command Line]") | checktime | endif]] })
|
||||
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' },
|
||||
{ command = [[if !bufexists("[Command Line]") | checktime | endif]] })
|
||||
|
||||
-- windows to close with "q"
|
||||
api.nvim_create_autocmd(
|
||||
@ -72,15 +72,8 @@ api.nvim_create_autocmd(
|
||||
)
|
||||
api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] })
|
||||
|
||||
-- show cursor line only in active window
|
||||
local cursorGrp = api.nvim_create_augroup('CursorLine', { clear = true })
|
||||
api.nvim_create_autocmd({ 'InsertLeave', 'WinEnter' }, { pattern = '*', command = 'set cursorline', group = cursorGrp })
|
||||
api.nvim_create_autocmd(
|
||||
{ 'InsertEnter', 'WinLeave' },
|
||||
{ pattern = '*', command = 'set nocursorline', group = cursorGrp }
|
||||
)
|
||||
-- don't auto comment new line
|
||||
api.nvim_create_autocmd('BufEnter', { command = [[set formatoptions-=cro]] })
|
||||
|
||||
-- Keep window ratio when resize
|
||||
api.nvim_create_autocmd('VimResized', {command = [[wincmd =]]})
|
||||
api.nvim_create_autocmd('VimResized', { command = [[wincmd =]] })
|
||||
|
@ -1,6 +1,4 @@
|
||||
vim.g.mapleader = ','
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<space>', 'nil', opts)
|
||||
|
||||
-- Tabs
|
||||
vim.keymap.set('n', '<S-Right>', ':tabnext<CR>', opts)
|
||||
@ -26,10 +24,38 @@ vim.keymap.set({ 'n', 'x' }, '<End>', 'g<End>', opts)
|
||||
vim.keymap.set('x', '<', '<gv')
|
||||
vim.keymap.set('x', '>', '>gv')
|
||||
|
||||
local function hlWord()
|
||||
local current_word = vim.call('expand', '<cword>')
|
||||
vim.fn.setreg('/', '\\<' .. current_word .. '\\>')
|
||||
vim.opt.hlsearch = true
|
||||
end
|
||||
|
||||
-- Highlight word under cursor
|
||||
vim.keymap.set('n', "'", ':let @/=\'\\<<C-R>=expand("<cword>")<CR>\\>\'<CR>:set hls<CR>', { noremap = true, silent = true })
|
||||
-- vim.keymap.set('v', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>")
|
||||
vim.keymap.set('x', "'", "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>", { noremap = true, silent = true })
|
||||
vim.keymap.set('n', "'", hlWord, { noremap = true, silent = true, desc = 'Higlight word under cursor' })
|
||||
vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true, desc = 'Highlight visual' })
|
||||
|
||||
-- Close Buffer
|
||||
vim.keymap.set('n', '<C-w>', ':bd<CR>')
|
||||
vim.keymap.set('n', '<C-w>', ':bd<CR>', { desc = 'Close buffer' })
|
||||
|
||||
vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })
|
||||
|
||||
|
||||
vim.keymap.set({ 'n', 'x' }, '<leader>y', '"+y', { desc = 'Copy from system clipboard' })
|
||||
vim.keymap.set({ 'n', 'x' }, '<leader>Y', '"+yg_', { desc = 'Copy from system clipboard' })
|
||||
vim.keymap.set({ 'n', 'x' }, '<leader>p', '"+p', { desc = 'Paste from system clipboard' })
|
||||
vim.keymap.set({ 'n', 'x' }, '<leader>P', '"+P', { desc = 'Paste from system clipboard' })
|
||||
|
||||
vim.api.nvim_create_user_command('WinFont', 'set guifont=JetBrainsMonoNL\\ NF:h9', {})
|
||||
vim.api.nvim_create_user_command('LinuxFont', 'set guifont=JetBrainsMono\\ Nerd\\ Font\\ Mono:h7', {})
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
local change_scale_factor = function(delta)
|
||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
|
||||
print(string.format('scaling: %f', vim.g.neovide_scale_factor))
|
||||
end
|
||||
vim.keymap.set('n', '<C-=>', function() change_scale_factor(1.25) end)
|
||||
vim.keymap.set('n', '<C-->', function() change_scale_factor(1 / 1.25) end)
|
||||
vim.keymap.set('n', '<C-ScrollWheelUp>', function() change_scale_factor(1.25) end)
|
||||
vim.keymap.set('n', '<C-ScrollWheelDown>', function() change_scale_factor(1 / 1.25) end)
|
||||
end
|
||||
|
@ -1,231 +0,0 @@
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost my_plugins.lua source <afile> | PackerCompile
|
||||
augroup end
|
||||
]])
|
||||
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
packer_bootstrap = fn.system({
|
||||
'git',
|
||||
'clone',
|
||||
'--depth',
|
||||
'1',
|
||||
'https://github.com/wbthomason/packer.nvim',
|
||||
install_path,
|
||||
})
|
||||
end
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local function get_setup(name)
|
||||
return string.format('require("setup/%s")', name)
|
||||
end
|
||||
|
||||
local packerUtil = require('packer.util')
|
||||
require('packer').init({
|
||||
snapshot_path = packerUtil.join_paths(vim.fn.stdpath('config'), 'snapshots'),
|
||||
display = {
|
||||
open_fn = require('packer.util').float,
|
||||
},
|
||||
})
|
||||
|
||||
return require('packer').startup(function()
|
||||
-- Packer can manage itself as an optional plugin
|
||||
use({ 'wbthomason/packer.nvim' })
|
||||
use({
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
config = get_setup('treesitter'),
|
||||
})
|
||||
use({
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = {
|
||||
{ 'nvim-lua/popup.nvim' },
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
{ 'kyazdani42/nvim-web-devicons' },
|
||||
{ 'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -G Ninja && cmake --build build --config Release && cmake --install build --prefix build' },
|
||||
},
|
||||
config = get_setup('telescope'),
|
||||
})
|
||||
use({
|
||||
'sainnhe/gruvbox-material',
|
||||
disable = true,
|
||||
config = get_setup('my_gruvbox-material')
|
||||
})
|
||||
use({
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
disable = true,
|
||||
config = get_setup('gruvbox'),
|
||||
})
|
||||
use({
|
||||
'luisiacc/gruvbox-baby',
|
||||
disable = false,
|
||||
config = get_setup('my_gruvbox-baby')
|
||||
})
|
||||
use({
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
requires = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
config = get_setup('indent_blankline'),
|
||||
})
|
||||
use({ 'nvim-lua/plenary.nvim' })
|
||||
use({
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = get_setup('gitsigns'),
|
||||
})
|
||||
use({
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
requires = 'kyazdani42/nvim-web-devicons',
|
||||
config = get_setup('nvim-tree'),
|
||||
disable = true,
|
||||
})
|
||||
use({
|
||||
'numToStr/Comment.nvim',
|
||||
config = get_setup('comment'),
|
||||
})
|
||||
use({
|
||||
'hrsh7th/nvim-cmp',
|
||||
requires = {
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'hrsh7th/cmp-nvim-lua' },
|
||||
{ 'octaltree/cmp-look' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-calc' },
|
||||
{ 'f3fora/cmp-spell' },
|
||||
{ 'hrsh7th/cmp-emoji' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'ray-x/cmp-treesitter' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
||||
{ 'p00f/clangd_extensions.nvim' },
|
||||
},
|
||||
config = get_setup('cmp'),
|
||||
})
|
||||
use({ 'L3MON4D3/LuaSnip', config = get_setup('luasnip') })
|
||||
use({ 'rafamadriz/friendly-snippets' })
|
||||
use({ 'onsails/lspkind-nvim' })
|
||||
use({ 'Shatur/neovim-cmake', requires = { 'mfussenegger/nvim-dap' }, config = get_setup('cmake') })
|
||||
use({
|
||||
'hoob3rt/lualine.nvim',
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||
config = get_setup('lualine'),
|
||||
})
|
||||
use({
|
||||
'ahmedkhalf/project.nvim',
|
||||
config = get_setup('project'),
|
||||
})
|
||||
use({ 'p00f/nvim-ts-rainbow',
|
||||
requires = 'nvim-treesitter/nvim-treesitter',
|
||||
})
|
||||
use({
|
||||
'windwp/nvim-autopairs',
|
||||
config = get_setup('nvim-autopairs'),
|
||||
})
|
||||
use({ 'ray-x/lsp_signature.nvim' })
|
||||
use({
|
||||
's1n7ax/nvim-terminal',
|
||||
config = get_setup('terminal'),
|
||||
})
|
||||
use({
|
||||
'williamboman/nvim-lsp-installer',
|
||||
requires = {
|
||||
'neovim/nvim-lspconfig',
|
||||
'p00f/clangd_extensions.nvim',
|
||||
},
|
||||
config = get_setup('lspinstall'),
|
||||
disable = true,
|
||||
})
|
||||
use({
|
||||
'neovim/nvim-lspconfig',
|
||||
requires = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'p00f/clangd_extensions.nvim',
|
||||
},
|
||||
config = get_setup('my_lspconfig'),
|
||||
})
|
||||
use({
|
||||
'jose-elias-alvarez/null-ls.nvim',
|
||||
requires = { 'nvim-lua/plenary.nvim' },
|
||||
})
|
||||
use({
|
||||
'danymat/neogen',
|
||||
requires = 'nvim-treesitter/nvim-treesitter',
|
||||
config = get_setup('neogen'),
|
||||
})
|
||||
use({ 'stevearc/dressing.nvim' })
|
||||
use({
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
requires = 'nvim-treesitter/nvim-treesitter',
|
||||
})
|
||||
use({
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
requires = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
config = get_setup('neo-tree'),
|
||||
})
|
||||
use({
|
||||
'akinsho/toggleterm.nvim',
|
||||
config = get_setup('toggleterm'),
|
||||
})
|
||||
use({
|
||||
'gfeiyou/command-center.nvim',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = get_setup('my_command_center'),
|
||||
})
|
||||
use({
|
||||
'gbprod/yanky.nvim',
|
||||
config = get_setup('yanky')
|
||||
})
|
||||
use {
|
||||
'ldelossa/litee.nvim',
|
||||
requires = {
|
||||
'ldelossa/litee-calltree.nvim',
|
||||
'ldelossa/litee-symboltree.nvim',
|
||||
'ldelossa/gh.nvim'
|
||||
},
|
||||
config = get_setup('my_litee')
|
||||
}
|
||||
use {
|
||||
'stevearc/aerial.nvim',
|
||||
config = get_setup('aerial')
|
||||
}
|
||||
use {
|
||||
'm-demare/hlargs.nvim',
|
||||
requires = { 'nvim-treesitter/nvim-treesitter' },
|
||||
config = get_setup('my_hlargs')
|
||||
}
|
||||
use {
|
||||
'ggandor/leap.nvim',
|
||||
requires = { 'tpope/vim-repeat' },
|
||||
config = get_setup('my_leap')
|
||||
}
|
||||
use {
|
||||
'mfussenegger/nvim-dap',
|
||||
requires = {
|
||||
'mfussenegger/nvim-dap-python',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
'nvim-telescope/telescope-dap.nvim',
|
||||
'rcarriga/cmp-dap',
|
||||
'rcarriga/nvim-dap-ui'
|
||||
},
|
||||
config = get_setup('my_dap')
|
||||
}
|
||||
use {
|
||||
'sindrets/diffview.nvim',
|
||||
requires = 'nvim-lua/plenary.nvim',
|
||||
config = get_setup('my_diffview')
|
||||
}
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
28
lua/overseer/template/user/cmake/build.lua
Normal file
28
lua/overseer/template/user/cmake/build.lua
Normal file
@ -0,0 +1,28 @@
|
||||
|
||||
return {
|
||||
name = 'CMake Build for nvim',
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { 'cmake' },
|
||||
args = { '--build', '.',
|
||||
'--', '-j8' },
|
||||
cwd = 'build_nvim',
|
||||
-- components = {"on_output_parse", problem_matcher = "$gcc"}
|
||||
-- components = {'on_output_quickfix', set_diagnostics = true, open = true}
|
||||
components = { { "on_output_quickfix", open = true, open_on_match = true },
|
||||
{ 'on_output_parse', problem_matcher = '$gcc' },
|
||||
'default' },
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
callback = function(opts)
|
||||
if vim.fn.executable("cmake") == 0 then
|
||||
return false, 'Command "cmake" not found'
|
||||
end
|
||||
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then
|
||||
return false, "No CMakeLists.txt found"
|
||||
end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
}
|
23
lua/overseer/template/user/cmake/clean.lua
Normal file
23
lua/overseer/template/user/cmake/clean.lua
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
return {
|
||||
name = 'CMake Clean for nvim',
|
||||
builder = function()
|
||||
return {
|
||||
cmd = { 'cmake' },
|
||||
args = { '--build', '.',
|
||||
'-t', 'clean' },
|
||||
cwd = 'build_nvim',
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
callback = function(opts)
|
||||
if vim.fn.executable("cmake") == 0 then
|
||||
return false, 'Command "cmake" not found'
|
||||
end
|
||||
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then
|
||||
return false, "No CMakeLists.txt found"
|
||||
end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
}
|
6
lua/overseer/template/user/cmake/cmake.lua
Normal file
6
lua/overseer/template/user/cmake/cmake.lua
Normal file
@ -0,0 +1,6 @@
|
||||
return {
|
||||
'builtin',
|
||||
'user.cmake.configure',
|
||||
'user.cmake.build',
|
||||
'user.cmake.clean'}
|
||||
-- https://gitlab.com/ranjithshegde/dotbare/-/tree/master/.config/nvim/lua/overseer
|
24
lua/overseer/template/user/cmake/configure.lua
Normal file
24
lua/overseer/template/user/cmake/configure.lua
Normal file
@ -0,0 +1,24 @@
|
||||
return {
|
||||
name = 'CMake Configure for nvim',
|
||||
builder = function()
|
||||
local cwd = vim.fn.getcwd()
|
||||
return {
|
||||
cmd = { 'cmake' },
|
||||
args = { '-B', 'build_nvim',
|
||||
'-S', cwd,
|
||||
'-G', 'Ninja' },
|
||||
cwd = build_nvim,
|
||||
}
|
||||
end,
|
||||
condition = {
|
||||
callback = function(opts)
|
||||
if vim.fn.executable("cmake") == 0 then
|
||||
return false, 'Command "cmake" not found'
|
||||
end
|
||||
if vim.fn.findfile("CMakeLists.txt", opts.dir .. ";") == "" then
|
||||
return false, "No CMakeLists.txt found"
|
||||
end
|
||||
return true
|
||||
end,
|
||||
},
|
||||
}
|
67
lua/plugins/advanced-git-search.lua
Normal file
67
lua/plugins/advanced-git-search.lua
Normal file
@ -0,0 +1,67 @@
|
||||
return {
|
||||
'aaronhallaert/advanced-git-search.nvim',
|
||||
config = function()
|
||||
require('telescope').load_extension('advanced_git_search')
|
||||
vim.api.nvim_create_user_command(
|
||||
'DiffCommitLine',
|
||||
'lua require("telescope").extensions.advanced_git_search.diff_commit_line()',
|
||||
{ range = true }
|
||||
)
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
-- to show diff splits and open commits in browser
|
||||
'tpope/vim-fugitive',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>hb',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.diff_branch_file()
|
||||
end,
|
||||
desc = 'Diff file against branch'
|
||||
},
|
||||
{
|
||||
'<leader>hl',
|
||||
':DiffCommitLine<cr>gv',
|
||||
desc = 'Diff current line againt previous commits',
|
||||
mode = { 'x', 'n' },
|
||||
noremap = true
|
||||
},
|
||||
{
|
||||
'<leader>hf',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.diff_commit_file()
|
||||
end,
|
||||
desc = 'Diff current file against previous commits'
|
||||
},
|
||||
{
|
||||
'<leader>ha',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.search_log_content()
|
||||
end,
|
||||
desc = 'Search git log'
|
||||
},
|
||||
{
|
||||
'<leader>hs',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.search_log_content_file()
|
||||
end,
|
||||
desc = 'Search git log that changed current file'
|
||||
},
|
||||
{
|
||||
'<leader>hr',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.checkout_reflog()
|
||||
end,
|
||||
desc = 'Search all reflog entries'
|
||||
},
|
||||
{
|
||||
'<leader>hh',
|
||||
function()
|
||||
require('telescope').extensions.advanced_git_search.show_custom_functions()
|
||||
end,
|
||||
desc = 'Shwo all git telecope functions'
|
||||
}
|
||||
}
|
||||
}
|
27
lua/plugins/aerial.lua
Normal file
27
lua/plugins/aerial.lua
Normal file
@ -0,0 +1,27 @@
|
||||
return {
|
||||
'stevearc/aerial.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim'
|
||||
},
|
||||
config = function()
|
||||
require('aerial').setup({
|
||||
backends = { 'lsp', 'treesitter', 'markdown' },
|
||||
layout = {
|
||||
default_direction = 'prefer_left'
|
||||
},
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
})
|
||||
require('telescope').load_extension('aerial')
|
||||
end,
|
||||
cmd = 'AerialToggle',
|
||||
keys = {
|
||||
{
|
||||
'<leader>s',
|
||||
function()
|
||||
require('aerial').toggle()
|
||||
end,
|
||||
desc = 'Symbols outline',
|
||||
}
|
||||
}
|
||||
}
|
37
lua/plugins/cmake-tools.lua
Normal file
37
lua/plugins/cmake-tools.lua
Normal file
@ -0,0 +1,37 @@
|
||||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
opts = {
|
||||
cmake_command = 'cmake',
|
||||
cmake_generate_options = { '-D', 'CMAKE_EXPORT_COMPILE_COMMANDS=1', '-G', 'Ninja' },
|
||||
cmake_show_console = 'always',
|
||||
cmake_build_directory = 'build_nvim',
|
||||
cmake_dap_configuration = { name = 'cpp', type = 'codelldb', request = 'launch' }, -- dap configuration, optional
|
||||
},
|
||||
cmd = {
|
||||
'CMakeGenerate',
|
||||
'CMakeBuild',
|
||||
'CMakeRun',
|
||||
'CMakeDebug',
|
||||
'CMakeSelectBuildType',
|
||||
'CMakeSelectBuildTarget',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeSelectKit',
|
||||
'CMakeSelectConfigurePreset',
|
||||
'CMakeSelectBuildPreset',
|
||||
'CMakeSelectLaunchTarget',
|
||||
'CMakeOpen',
|
||||
'CMakeClose',
|
||||
'CMakeInstall',
|
||||
'CMakeClean',
|
||||
'CMakeStop',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<S-F6>',
|
||||
function()
|
||||
require('cmake-tools').debug({})
|
||||
end,
|
||||
desc = 'Run and debug target from cmake'
|
||||
}
|
||||
}
|
||||
}
|
178
lua/plugins/cmp.lua
Normal file
178
lua/plugins/cmp.lua
Normal file
@ -0,0 +1,178 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
dependencies = {
|
||||
{ 'onsails/lspkind-nvim' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'hrsh7th/cmp-nvim-lua' },
|
||||
{ 'octaltree/cmp-look' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-calc' },
|
||||
{ 'f3fora/cmp-spell' },
|
||||
{ 'hrsh7th/cmp-emoji' },
|
||||
{ 'hrsh7th/cmp-cmdline' },
|
||||
{ 'dmitmel/cmp-cmdline-history' },
|
||||
{ 'ray-x/cmp-treesitter' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
||||
{ 'p00f/clangd_extensions.nvim' },
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
config = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = require('lspkind').cmp_format({
|
||||
mode = 'symbol_text', -- show only symbol annotations
|
||||
maxwidth = 80, -- prevent the popup from showing more than provided characters (e.g 50 will not show more than 50 characters)
|
||||
ellipsis_char = '...', -- when popup menu exceed maxwidth, the truncated part would show ellipsis_char instead (must define maxwidth first)
|
||||
})
|
||||
},
|
||||
mapping = {
|
||||
['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),
|
||||
['<Down>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c', 's' }),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c', 's' }),
|
||||
['<C-e>'] = cmp.mapping(cmp.mapping.close(), { 'i', 'c', 's' }),
|
||||
['<CR>'] = cmp.mapping({
|
||||
i = function(fallback)
|
||||
if cmp.visible() and cmp.get_active_entry() then
|
||||
cmp.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = false })
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
c = cmp.mapping.confirm({ select = false }),
|
||||
s = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.expand_or_jumpable() then
|
||||
vim.api.nvim_feedkeys(t('<Plug>luasnip-expand-or-jump'), '', true)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
'i',
|
||||
's',
|
||||
}),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
vim.api.nvim_feedkeys(t('<Plug>luasnip-jump-prev'), '', true)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, { 'i', 's', }),
|
||||
['<c-x>'] = cmp.mapping(cmp.mapping.complete(
|
||||
{
|
||||
config = {
|
||||
sources = {
|
||||
{
|
||||
name = 'cmdline_history'
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
), { 'c' }),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'luasnip', priority = 8 },
|
||||
{ name = 'nvim_lsp', priority = 7 },
|
||||
{ name = 'nvim_lsp_signature_help', priority = 7 },
|
||||
{ name = 'treesitter', priority = 6 },
|
||||
{
|
||||
name = 'buffer',
|
||||
priority = 5,
|
||||
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 = 'nvim_lua' },
|
||||
-- { name = 'look' },
|
||||
-- { name = 'path' },
|
||||
-- { name = 'cmp_tabnine' },
|
||||
-- { name = 'calc' },
|
||||
-- { name = 'spell' },
|
||||
-- { name = 'emoji' },
|
||||
},
|
||||
enabled = function()
|
||||
return vim.api.nvim_buf_get_option(0, 'buftype') ~= 'prompt'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dap-repl'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_watches'
|
||||
or vim.api.nvim_buf_get_option(0, 'filetype') == 'dapui_hover'
|
||||
end,
|
||||
completion = { completeopt = 'menu,menuone,noinsert, noselect' },
|
||||
window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
sorting = {
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
cmp.config.compare.recently_used,
|
||||
require('clangd_extensions.cmp_scores'),
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
-- experimental = { native_menu = true }
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = {
|
||||
{ name = 'cmdline' },
|
||||
-- { name = 'cmdline_history' },
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
})
|
||||
|
||||
require('cmp').setup.filetype({ 'dap-repl', 'dapui_watches', 'dapui_hover' }, {
|
||||
sources = {
|
||||
{ name = 'dap' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Autopairs
|
||||
--require("nvim-autopairs.completion.cmp").setup({
|
||||
-- map_cr = true,
|
||||
-- map_complete = true,
|
||||
-- auto_select = true
|
||||
--})
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
|
||||
end,
|
||||
event = { 'InsertEnter', 'CmdLineEnter' },
|
||||
}
|
20
lua/plugins/comment.lua
Normal file
20
lua/plugins/comment.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
mappings = false,
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_current)',
|
||||
desc = 'Toggle comment'
|
||||
},
|
||||
|
||||
{
|
||||
'<c-c>',
|
||||
'<Plug>(comment_toggle_linewise_visual)gv',
|
||||
mode = 'v',
|
||||
desc = 'Toggle comment'
|
||||
}
|
||||
}
|
||||
}
|
226
lua/plugins/dap.lua
Normal file
226
lua/plugins/dap.lua
Normal file
@ -0,0 +1,226 @@
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
'mfussenegger/nvim-dap-python',
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
{
|
||||
'nvim-telescope/telescope-dap.nvim',
|
||||
dependencies = 'telescope.nvim',
|
||||
},
|
||||
'rcarriga/nvim-dap-ui',
|
||||
'rcarriga/cmp-dap',
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<F5>',
|
||||
function()
|
||||
require('dap').continue()
|
||||
end,
|
||||
desc = 'DAP start or continue'
|
||||
},
|
||||
{
|
||||
'<S-F5>',
|
||||
function()
|
||||
require('dap').run_last()
|
||||
end,
|
||||
desc = 'DAP run last'
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function()
|
||||
loadConfigs()
|
||||
end,
|
||||
desc = 'DAP configs'
|
||||
},
|
||||
{
|
||||
'<F7>',
|
||||
function()
|
||||
require('dap').goto_()
|
||||
end,
|
||||
desc = 'DAP goto'
|
||||
},
|
||||
{
|
||||
'<F8>',
|
||||
function()
|
||||
require('dap.ui.widgets').hover()
|
||||
end,
|
||||
desc = 'DAP Hover'
|
||||
},
|
||||
{
|
||||
'<F9>',
|
||||
function()
|
||||
require('dap').toggle_breakpoint()
|
||||
end,
|
||||
desc = 'DAP breakpoint'
|
||||
},
|
||||
{
|
||||
'<F10>',
|
||||
function()
|
||||
require('dap').step_over()
|
||||
end,
|
||||
desc = 'DAP step_over'
|
||||
},
|
||||
{
|
||||
'<F11>',
|
||||
function()
|
||||
require('dap').step_into()
|
||||
end,
|
||||
desc = 'DAP step_into'
|
||||
},
|
||||
{
|
||||
'<S-F11>',
|
||||
function()
|
||||
require('dap').step_out()
|
||||
end,
|
||||
desc = 'DAP step_out'
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local dap = require('dap')
|
||||
vim.fn.sign_define('DapBreakpoint', { text = '🛑', texthl = '', linehl = '', numhl = '' })
|
||||
require('cmp_dap').is_dap_buffer()
|
||||
|
||||
|
||||
-- make sure we can exit the terminal with esc
|
||||
vim.api.nvim_create_autocmd({ 'TermOpen' }, {
|
||||
pattern = { '*dap-terminal*' },
|
||||
callback = function()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end
|
||||
})
|
||||
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
|
||||
function loadConfigs()
|
||||
require('dap.ext.vscode').load_launchjs()
|
||||
-- Make sure we use the correct python env even for the configs from launch.json
|
||||
for _, config in pairs(dap.configurations.python) do
|
||||
config.pythonPath = pythonVenv.getPythonEnv()
|
||||
config.cwd = vim.fn.getcwd()
|
||||
end
|
||||
require 'telescope'.extensions.dap.configurations {}
|
||||
end
|
||||
|
||||
local masonpath = vim.fn.stdpath('data') .. '/mason'
|
||||
|
||||
-- PYTHON
|
||||
dap.adapters.python = {
|
||||
type = 'executable',
|
||||
command = masonpath .. '/packages/debugpy/venv/' .. pythonVenv.getVenvSuffix(),
|
||||
args = { '-m', 'debugpy.adapter' },
|
||||
options = {
|
||||
detached = true,
|
||||
},
|
||||
}
|
||||
|
||||
local dapui = require('dapui')
|
||||
dapui.setup()
|
||||
dap.listeners.after.event_initialized['dapui_config'] = function()
|
||||
dapui.open({})
|
||||
end
|
||||
dap.listeners.before.event_terminated['dapui_config'] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
dap.listeners.before.event_exited['dapui_config'] = function()
|
||||
dapui.close({})
|
||||
end
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = 'python',
|
||||
request = 'launch',
|
||||
name = 'Launch file with venv',
|
||||
justMyCode = false,
|
||||
program = '${file}',
|
||||
cwd = vim.fn.getcwd(),
|
||||
pythonPath = pythonVenv.getPythonEnv
|
||||
},
|
||||
}
|
||||
|
||||
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python')
|
||||
-- table.insert(require('dap').configurations.python, {
|
||||
-- -- type = 'python',
|
||||
-- -- request = 'launch',
|
||||
-- -- name = 'My custom launch configuration',
|
||||
-- -- program = '${file}',
|
||||
-- justMyCode = false
|
||||
-- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
|
||||
-- })
|
||||
-- require('dap-python').setup('C:/Users/oli/AppData/Local/nvim-data/mason/packages/debugpy/venv/Scripts/python.exe')
|
||||
|
||||
-- CPP
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = '${port}',
|
||||
executable = {
|
||||
-- CHANGE THIS to your path!
|
||||
command = masonpath .. '/bin/codelldb.cmd',
|
||||
args = { '--port', '${port}' },
|
||||
|
||||
-- On windows you may have to uncomment this:
|
||||
detached = false,
|
||||
}
|
||||
}
|
||||
|
||||
dap.adapters.cppdbg = {
|
||||
id = 'cppdbg',
|
||||
type = 'executable',
|
||||
command = masonpath .. '/bin/OpenDebugAD7',
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = function()
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return 'lldb-vscode'
|
||||
else
|
||||
return os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe'
|
||||
end
|
||||
end,
|
||||
name = 'lldb'
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = 'Launch codelldb',
|
||||
type = 'codelldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
},
|
||||
{
|
||||
name = 'Launch lldb',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- EXTENSIONS
|
||||
|
||||
require('nvim-dap-virtual-text').setup({})
|
||||
require('telescope').load_extension('dap')
|
||||
end,
|
||||
}
|
16
lua/plugins/diffview.lua
Normal file
16
lua/plugins/diffview.lua
Normal file
@ -0,0 +1,16 @@
|
||||
return {
|
||||
'sindrets/diffview.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
config = true,
|
||||
cmd = 'DiffviewOpen',
|
||||
keys = {
|
||||
{
|
||||
'<space>b',
|
||||
'<cmd>DiffviewOpen origin/develop...<cr>',
|
||||
desc = 'Diffview vs develop',
|
||||
},
|
||||
|
||||
}
|
||||
}
|
3
lua/plugins/dressing.lua
Normal file
3
lua/plugins/dressing.lua
Normal file
@ -0,0 +1,3 @@
|
||||
return {
|
||||
'stevearc/dressing.nvim'
|
||||
}
|
12
lua/plugins/gitsigns.lua
Normal file
12
lua/plugins/gitsigns.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
current_line_blame = false,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
}
|
||||
}
|
35
lua/plugins/gruvbox.lua
Normal file
35
lua/plugins/gruvbox.lua
Normal file
@ -0,0 +1,35 @@
|
||||
return {
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local colors = require('gruvbox.palette').colors
|
||||
|
||||
require('gruvbox').setup({
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = false,
|
||||
italic = {
|
||||
strings = false,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
palette_overrides = {},
|
||||
overrides = {
|
||||
['@lsp.type.parameter'] = { fg = colors.faded_purple },
|
||||
['@lsp.type.function'] = { fg = '#797df2' },
|
||||
['@lsp.type.method'] = { fg = '#797df2' },
|
||||
['@lsp.mod.readonly'] = { bold = true },
|
||||
},
|
||||
dim_inactive = true,
|
||||
transparent_mode = false,
|
||||
})
|
||||
-- vim.cmd('colorscheme gruvbox')
|
||||
end,
|
||||
enabled = true
|
||||
}
|
19
lua/plugins/gruvbox_flat.lua
Normal file
19
lua/plugins/gruvbox_flat.lua
Normal file
@ -0,0 +1,19 @@
|
||||
return {
|
||||
'eddyekofo94/gruvbox-flat.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local colors = require('gruvbox.colors')
|
||||
vim.g.gruvbox_flat_style = 'dark'
|
||||
vim.g.gruvbox_colors = {
|
||||
bg_search = 'purple',
|
||||
fg_search = 'black',
|
||||
}
|
||||
vim.g.gruvbox_theme = {
|
||||
Pmenu = { bg = 'bg_visual' },
|
||||
NormalFloat = { bg = 'bg_visual' }
|
||||
}
|
||||
vim.g.gruvbox_dark_float = false
|
||||
vim.cmd('colorscheme gruvbox-flat')
|
||||
end,
|
||||
enabled = false
|
||||
}
|
42
lua/plugins/gruvbox_material.lua
Normal file
42
lua/plugins/gruvbox_material.lua
Normal file
@ -0,0 +1,42 @@
|
||||
return {
|
||||
'sainnhe/gruvbox-material',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
-- local colors = require('gruvbox.colors')
|
||||
-- vim.g.gruvbox_flat_style = "dark"
|
||||
-- vim.g.gruvbox_colors = {
|
||||
-- bg_search = 'purple',
|
||||
-- fg_search = 'black',
|
||||
-- }
|
||||
-- vim.g.gruvbox_theme = {
|
||||
-- Pmenu = { bg = 'bg_visual' },
|
||||
-- NormalFloat = { bg = 'bg_visual' }
|
||||
-- }
|
||||
-- vim.g.gruvbox_dark_float = false
|
||||
vim.g.gruvbox_material_ui_contrast = 'high'
|
||||
vim.g.gruvbox_material_dim_inactive_windows = 1 -- Dim inactive windows. Only works in neovim currently.
|
||||
vim.g.gruvbox_material_disable_terminal_colors = 0
|
||||
local links = {
|
||||
['@lsp.type.namespace'] = '@namespace',
|
||||
['@lsp.type.type'] = '@type',
|
||||
['@lsp.type.class'] = '@type',
|
||||
['@lsp.type.enum'] = '@type',
|
||||
['@lsp.type.interface'] = '@type',
|
||||
['@lsp.type.struct'] = '@structure',
|
||||
['@lsp.type.parameter'] = '@parameter',
|
||||
['@lsp.type.variable'] = '@variable',
|
||||
['@lsp.type.property'] = '@property',
|
||||
['@lsp.type.enumMember'] = '@constant',
|
||||
['@lsp.type.function'] = '@function',
|
||||
['@lsp.type.method'] = '@method',
|
||||
['@lsp.type.macro'] = '@macro',
|
||||
['@lsp.type.decorator'] = '@function',
|
||||
}
|
||||
-- for newgroup, oldgroup in pairs(links) do
|
||||
-- vim.api.nvim_set_hl(0, newgroup, { link = oldgroup, default = true })
|
||||
-- end
|
||||
vim.cmd('colorscheme gruvbox-material')
|
||||
vim.api.nvim_set_hl(0, '@lsp.mod.readonly', { italic = true, fg = 'Purple' })
|
||||
end,
|
||||
enabled = false
|
||||
}
|
20
lua/plugins/indent_blankline.lua
Normal file
20
lua/plugins/indent_blankline.lua
Normal file
@ -0,0 +1,20 @@
|
||||
return {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
},
|
||||
opts = {
|
||||
show_end_of_line = true,
|
||||
use_treesitter = true,
|
||||
show_current_context = true,
|
||||
context_patterns = { 'class', 'function', 'method', 'block', '^if', '^for', '^while' },
|
||||
|
||||
},
|
||||
config = function()
|
||||
local opt = vim.opt -- to set options
|
||||
opt.listchars:append('eol:↴')
|
||||
-- opt.listchars:append("space: ")
|
||||
opt.listchars:append('trail: ')
|
||||
opt.listchars:append('tab:→ ')
|
||||
end,
|
||||
}
|
2
lua/plugins/init.lua
Normal file
2
lua/plugins/init.lua
Normal file
@ -0,0 +1,2 @@
|
||||
return {
|
||||
}
|
25
lua/plugins/lazygit.lua
Normal file
25
lua/plugins/lazygit.lua
Normal file
@ -0,0 +1,25 @@
|
||||
return {
|
||||
'kdheepak/lazygit.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim'
|
||||
},
|
||||
cmd = {
|
||||
'LazyGit',
|
||||
'LazyGitConfig',
|
||||
'LazyGitFilter',
|
||||
'LazyGitFilterCurrentFile',
|
||||
'LazyGit',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('lazygit')
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<Space>g',
|
||||
function()
|
||||
require('lazygit').lazygit()
|
||||
end,
|
||||
desc = 'LazyGit'
|
||||
}
|
||||
}
|
||||
}
|
8
lua/plugins/leap.lua
Normal file
8
lua/plugins/leap.lua
Normal file
@ -0,0 +1,8 @@
|
||||
return {
|
||||
'ggandor/leap.nvim',
|
||||
dependencies = { 'tpope/vim-repeat' },
|
||||
config = function()
|
||||
require('leap').set_default_keymaps()
|
||||
end,
|
||||
event = 'VeryLazy'
|
||||
}
|
14
lua/plugins/lsp_lines.lua
Normal file
14
lua/plugins/lsp_lines.lua
Normal file
@ -0,0 +1,14 @@
|
||||
return {
|
||||
'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
|
||||
config = true,
|
||||
keys = {
|
||||
{
|
||||
'<space>l',
|
||||
function()
|
||||
require('lsp_lines').toggle()
|
||||
end,
|
||||
desc = 'Toggle lsp_lines',
|
||||
}
|
||||
},
|
||||
event = 'LspAttach'
|
||||
}
|
322
lua/plugins/lspconfig.lua
Normal file
322
lua/plugins/lspconfig.lua
Normal file
@ -0,0 +1,322 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'p00f/clangd_extensions.nvim',
|
||||
'jose-elias-alvarez/null-ls.nvim',
|
||||
'ray-x/lsp_signature.nvim',
|
||||
{
|
||||
'folke/neodev.nvim',
|
||||
config = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require('mason').setup({
|
||||
ui = {
|
||||
border = 'rounded'
|
||||
}
|
||||
})
|
||||
require('mason-lspconfig').setup({
|
||||
automatic_installation = false,
|
||||
})
|
||||
local lspconfig = require 'lspconfig'
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceText',
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = '#5a524c'
|
||||
}
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceRead',
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkGreen'
|
||||
}
|
||||
)
|
||||
vim.api.nvim_set_hl(
|
||||
0,
|
||||
'LspReferenceWrite',
|
||||
{
|
||||
bold = true,
|
||||
ctermbg = 'red',
|
||||
bg = 'DarkRed'
|
||||
}
|
||||
)
|
||||
local diagnostics = {
|
||||
Error = ' ',
|
||||
Warning = ' ',
|
||||
Information = ' ',
|
||||
Question = ' ',
|
||||
Hint = ' ',
|
||||
}
|
||||
local signs = {
|
||||
{ name = 'DiagnosticSignError', text = diagnostics.Error },
|
||||
{ name = 'DiagnosticSignWarn', text = diagnostics.Warning },
|
||||
{ name = 'DiagnosticSignHint', text = diagnostics.Hint },
|
||||
{ name = 'DiagnosticSignInfo', text = diagnostics.Information },
|
||||
}
|
||||
|
||||
for _, sign in ipairs(signs) do
|
||||
vim.fn.sign_define(sign.name, { texthl = sign.name, text = sign.text, numhl = sign.name })
|
||||
end
|
||||
|
||||
OpenDiagFloat = function()
|
||||
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||
if vim.api.nvim_win_get_config(winid).zindex then
|
||||
return
|
||||
end
|
||||
end
|
||||
vim.diagnostic.open_float({ focusable = false, width = 80 })
|
||||
end
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_option(0, 'formatexpr', 'v:lua.vim.lsp.formatexpr()')
|
||||
|
||||
-- Mappings.
|
||||
local tele_builtins = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev,
|
||||
{ noremap = true, silent = false, desc = 'Diag prev', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>;', vim.diagnostic.goto_next,
|
||||
{ noremap = true, silent = false, desc = 'Diag next', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>a', vim.lsp.buf.code_action,
|
||||
{ noremap = true, silent = false, desc = 'Code action', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>d', tele_builtins.lsp_definitions,
|
||||
{ noremap = true, silent = false, desc = 'Definition', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>e', vim.lsp.buf.declaration,
|
||||
{ noremap = true, silent = false, desc = 'Declaration', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>h', vim.lsp.buf.hover,
|
||||
{ noremap = true, silent = false, desc = 'Hover', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls,
|
||||
{ noremap = true, silent = false, desc = 'Outgoing calls', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls,
|
||||
{ noremap = true, silent = false, desc = 'Incoming calls', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename,
|
||||
{ noremap = true, silent = false, desc = 'Rename', buffer = bufnr })
|
||||
vim.keymap.set('n', '<C-t>', tele_builtins.lsp_dynamic_workspace_symbols,
|
||||
{ noremap = true, silent = false, desc = 'Workspace symbols', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition,
|
||||
{ noremap = true, silent = false, desc = 'Type definition', buffer = bufnr })
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help,
|
||||
{ noremap = true, silent = false, desc = 'Signature help', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>r', tele_builtins.lsp_references,
|
||||
{ noremap = true, silent = false, desc = 'References', buffer = bufnr })
|
||||
vim.keymap.set('n', '<A-m>', tele_builtins.lsp_document_symbols,
|
||||
{ noremap = true, silent = false, desc = 'References', buffer = bufnr })
|
||||
vim.keymap.set('n', '<scapce>s', tele_builtins.lsp_dynamic_workspace_symbols,
|
||||
{ noremap = true, silent = false, desc = 'Workspace symbols', buffer = bufnr })
|
||||
vim.keymap.set('n', '<space>v', function() tele_builtins.diagnostics({ bufnr = 0 }) end,
|
||||
{ noremap = true, silent = false, desc = 'Diagnostics', buffer = bufnr })
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>',
|
||||
{ noremap = true, silent = false, desc = 'Switch Source/Header', buffer = bufnr })
|
||||
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.keymap.set('n', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format file', buffer = bufnr })
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.keymap.set('x', '<space>f', function()
|
||||
vim.lsp.buf.format({ timeout_ms = 10000 })
|
||||
end,
|
||||
{ noremap = true, silent = false, desc = 'Format visual', buffer = bufnr })
|
||||
end
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.server_capabilities.documentHighlightProvider then
|
||||
local group = vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
|
||||
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||
callback = function()
|
||||
vim.lsp.buf.document_highlight()
|
||||
end,
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
desc = 'Document Highlight',
|
||||
})
|
||||
vim.api.nvim_create_autocmd('CursorMoved', {
|
||||
callback = function()
|
||||
vim.lsp.buf.clear_references()
|
||||
end,
|
||||
buffer = bufnr,
|
||||
group = group,
|
||||
desc = 'Clear All the References',
|
||||
})
|
||||
vim.api.nvim_create_autocmd({ 'LspDetach' }, {
|
||||
group = group,
|
||||
buffer = bufnr,
|
||||
callback = function()
|
||||
vim.lsp.buf.clear_references()
|
||||
vim.api.nvim_clear_autocmds {
|
||||
group = group,
|
||||
buffer = bufnr
|
||||
}
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
require('lsp_signature').on_attach({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = 'single',
|
||||
},
|
||||
hi_parameter = 'IncSearch',
|
||||
}, bufnr)
|
||||
end
|
||||
|
||||
lspconfig['pyright'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
lspconfig['groovyls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
-- lspconfig['cmake'].setup {
|
||||
-- capabilities = capabilities,
|
||||
-- on_attach = on_attach,
|
||||
-- }
|
||||
|
||||
local configs = require('lspconfig.configs')
|
||||
if not configs.neocmake then
|
||||
configs.neocmake = {
|
||||
default_config = {
|
||||
cmd = { 'neocmakelsp', '--stdio' },
|
||||
filetypes = { 'cmake' },
|
||||
root_dir = function(fname)
|
||||
return lspconfig.util.find_git_ancestor(fname)
|
||||
end,
|
||||
single_file_support = true, -- suggested
|
||||
on_attach = on_attach -- on_attach is the on_attach function you defined
|
||||
}
|
||||
}
|
||||
lspconfig.neocmake.setup({})
|
||||
end
|
||||
|
||||
local clangd_capabilities = capabilities
|
||||
clangd_capabilities.textDocument.semanticHighlighting = true
|
||||
clangd_capabilities.offsetEncoding = { 'utf-16' }
|
||||
require('clangd_extensions').setup {
|
||||
server = {
|
||||
capabilities = clangd_capabilities,
|
||||
on_attach = on_attach,
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim', '--query-driver',
|
||||
'/opt/cortex-a78-2022.08-gcc12.1-linux5.15/bin/aarch64-linux-gnu-g*' },
|
||||
root_dir = lspconfig.util.root_pattern(
|
||||
'.clangd',
|
||||
'.clang-tidy',
|
||||
'.clang-format',
|
||||
'compile_flags.txt',
|
||||
'configure.ac',
|
||||
'.git',
|
||||
'build_nvim'
|
||||
)
|
||||
},
|
||||
extensions =
|
||||
{
|
||||
inlay_hints = {
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = true,
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
lspconfig['jsonls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
local lua_rtp = vim.split(package.path, ';')
|
||||
table.insert(lua_rtp, 'lua/?.lua')
|
||||
table.insert(lua_rtp, 'lua/?/init.lua')
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = lua_rtp,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
format = {
|
||||
enable = true,
|
||||
defaultConfig = {
|
||||
indent_style = 'space',
|
||||
indent_size = '2',
|
||||
quote_style = 'single',
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
lspconfig['dockerls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
lspconfig['yamlls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
validate = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local null_ls = require('null-ls')
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
-- null_ls.builtins.formatting.black,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.formatting.xmlformat,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.cmake_format,
|
||||
},
|
||||
debug = true,
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
-- vim.diagnostic.config({ virtual_text = false })
|
||||
vim.diagnostic.config({ virtual_text = false, virtual_lines = { only_current_line = true } })
|
||||
end,
|
||||
event = 'VeryLazy'
|
||||
}
|
126
lua/plugins/lualine.lua
Normal file
126
lua/plugins/lualine.lua
Normal file
@ -0,0 +1,126 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
local custom_gruvbox = require 'lualine.themes.gruvbox_dark'
|
||||
|
||||
-- Change the background of lualine_c section for normal mode
|
||||
custom_gruvbox.normal.a.bg = '#282828'
|
||||
custom_gruvbox.normal.b.bg = '#282828'
|
||||
custom_gruvbox.normal.c.bg = '#282828'
|
||||
-- custom_gruvbox.normal.a.fg = '#282828'
|
||||
-- custom_gruvbox.normal.b.fg = '#282828'
|
||||
-- custom_gruvbox.normal.c.fg = '#282828'
|
||||
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
-- theme = custom_gruvbox,
|
||||
theme = 'gruvbox_dark',
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = { 'dap-repl', 'dapui_console' },
|
||||
},
|
||||
},
|
||||
globalstatus = true,
|
||||
extensions = { 'aerial' },
|
||||
sections = {
|
||||
lualine_b = {
|
||||
'branch',
|
||||
'diff',
|
||||
{
|
||||
'diagnostics',
|
||||
sources = { 'nvim_diagnostic' }
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
'hostname',
|
||||
'getcwd',
|
||||
{ 'filename', path = 1, file_status = true }
|
||||
},
|
||||
lualine_y = {
|
||||
'searchcount',
|
||||
'progress'
|
||||
},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_c = {
|
||||
'getcwd',
|
||||
{
|
||||
'filename',
|
||||
path = 1,
|
||||
file_status = true
|
||||
}
|
||||
}
|
||||
},
|
||||
winbar = {
|
||||
lualine_a = {
|
||||
{
|
||||
'filename',
|
||||
path = 0,
|
||||
file_status = true,
|
||||
separator = { left = '', right = '' },
|
||||
-- color = { fg = '#ffaa88', gui = 'bold' }
|
||||
color = { fg = '#ffaa88', bg = '#282828', gui = 'bold' }
|
||||
}
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
'filesize',
|
||||
color = { bg = '#282828' }
|
||||
}
|
||||
},
|
||||
lualine_c = {
|
||||
{
|
||||
'aerial',
|
||||
color = { fg = '#ebdbb2', bg = '#282828', gui = 'bold' }
|
||||
}
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {
|
||||
}
|
||||
},
|
||||
inactive_winbar = {
|
||||
lualine_a = {
|
||||
{
|
||||
'filename',
|
||||
path = 0,
|
||||
file_status = true,
|
||||
separator = { left = '', right = '' },
|
||||
color = { fg = '#ffaa88', bg = '#282828', gui = 'bold' }
|
||||
-- color = { fg = '#ffaa88', bg = 'grey', gui = 'italic,bold' }
|
||||
-- color = { fg = '#ff1111'}
|
||||
}
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
'filesize',
|
||||
color = { bg = '#282828' }
|
||||
}
|
||||
},
|
||||
lualine_c = { 'aerial' },
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
tabline = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {
|
||||
{
|
||||
'tabs',
|
||||
mode = 2,
|
||||
tabs_color = {
|
||||
-- Same values as the general color option can be used here.
|
||||
active = 'lualine_a_normal', -- Color for active tab.
|
||||
inactive = 'lualine_a_inactive', -- Color for inactive tab.
|
||||
},
|
||||
}
|
||||
},
|
||||
lualine_x = {},
|
||||
lualine_y = {},
|
||||
lualine_z = {}
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
66
lua/plugins/luasnip.lua
Normal file
66
lua/plugins/luasnip.lua
Normal file
@ -0,0 +1,66 @@
|
||||
return {
|
||||
'L3MON4D3/LuaSnip',
|
||||
config = function()
|
||||
local ls = require('luasnip')
|
||||
-- some shorthands...
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local l = require('luasnip.extras').lambda
|
||||
local rep = require('luasnip.extras').rep
|
||||
local p = require('luasnip.extras').partial
|
||||
local m = require('luasnip.extras').match
|
||||
local n = require('luasnip.extras').nonempty
|
||||
local dl = require('luasnip.extras').dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local types = require('luasnip.util.types')
|
||||
local conds = require('luasnip.extras.expand_conditions')
|
||||
|
||||
local function getRegA(capitalize)
|
||||
local clipboard = vim.fn.getreg('a')
|
||||
clipboard = clipboard:gsub('^m_', '')
|
||||
if capitalize then
|
||||
clipboard = clipboard:gsub('^%l', string.upper)
|
||||
end
|
||||
return clipboard
|
||||
end
|
||||
|
||||
ls.snippets = {
|
||||
cpp = {
|
||||
s('TEST_F_getset',
|
||||
{
|
||||
t('TEST_F('), i(1, 'TestClass'), t(' ,test_'), p(getRegA, false), t({ '_set_get)', '{', ' ' }),
|
||||
i(2, 'm_object'), t('.set'), p(getRegA, true), t('('), i(3, '32.F'), t({ ');', ' ' }),
|
||||
i(4, 'EXPECT_EQ('), rep(3), t(', '), rep(2), t('.get'), p(getRegA, true), t({ '());', '' }),
|
||||
t({ '', '}', '' })
|
||||
}),
|
||||
s('TEST_fn_getset',
|
||||
{
|
||||
t('void '), p(getRegA, false), t('_'), i(1, 'get'), t('_'), i(2, 'set'), t({ '()', '{', ' ' }),
|
||||
i(3, 'm_object'), t('.set'), p(getRegA, true), t('('), i(4, '32.F'), t({ ');', ' ' }),
|
||||
i(5, 'EXPECT_EQ('), rep(4), t(', '), rep(3), t('.get'), p(getRegA, true), t({ '());', '' }),
|
||||
t({ '', '}', '', '' }),
|
||||
|
||||
t('TEST_F('), i(5), t(' ,test_'), p(getRegA, false), t({ '_set_get)', '{', ' ' }),
|
||||
p(getRegA, false), t('_'), rep(1), t('_'), rep(2), t({ '();' }),
|
||||
t({ '', '}' }),
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { './my-snippets' } })
|
||||
end,
|
||||
dependencies =
|
||||
{
|
||||
'rafamadriz/friendly-snippets'
|
||||
},
|
||||
cmd = 'LuaSnipListAvailable'
|
||||
}
|
73
lua/plugins/material.lua
Normal file
73
lua/plugins/material.lua
Normal file
@ -0,0 +1,73 @@
|
||||
return {
|
||||
'marko-cerovac/material.nvim',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local colors = require 'material.colors'
|
||||
require('material').setup({
|
||||
|
||||
contrast = {
|
||||
terminal = false, -- Enable contrast for the built-in terminal
|
||||
sidebars = false, -- Enable contrast for sidebar-like windows ( for example Nvim-Tree )
|
||||
floating_windows = true, -- Enable contrast for floating windows
|
||||
cursor_line = false, -- Enable darker background for the cursor line
|
||||
non_current_windows = true, -- Enable darker background for non-current windows
|
||||
filetypes = {}, -- Specify which filetypes get the contrasted (darker) background
|
||||
},
|
||||
|
||||
styles = { -- Give comments style such as bold, italic, underline etc.
|
||||
comments = { --[[ italic = true ]] },
|
||||
strings = { --[[ bold = true ]] },
|
||||
keywords = { --[[ underline = true ]] },
|
||||
functions = { --[[ bold = true, undercurl = true ]] },
|
||||
variables = {},
|
||||
operators = {},
|
||||
types = {},
|
||||
},
|
||||
|
||||
plugins = { -- Uncomment the plugins that you use to highlight them
|
||||
-- Available plugins:
|
||||
"dap",
|
||||
-- "dashboard",
|
||||
"gitsigns",
|
||||
-- "hop",
|
||||
"indent-blankline",
|
||||
-- "lspsaga",
|
||||
-- "mini",
|
||||
-- "neogit",
|
||||
-- "neorg",
|
||||
"nvim-cmp",
|
||||
"nvim-navic",
|
||||
-- "nvim-tree",
|
||||
"nvim-web-devicons",
|
||||
-- "sneak",
|
||||
"telescope",
|
||||
-- "trouble",
|
||||
"which-key",
|
||||
},
|
||||
|
||||
disable = {
|
||||
colored_cursor = false, -- Disable the colored cursor
|
||||
borders = false, -- Disable borders between verticaly split windows
|
||||
background = false, -- Prevent the theme from setting the background (NeoVim then uses your terminal background)
|
||||
term_colors = false, -- Prevent the theme from setting terminal colors
|
||||
eob_lines = false -- Hide the end-of-buffer lines
|
||||
},
|
||||
|
||||
high_visibility = {
|
||||
lighter = false, -- Enable higher contrast text for lighter style
|
||||
darker = true-- Enable higher contrast text for darker style
|
||||
},
|
||||
|
||||
lualine_style = 'default', -- Lualine style ( can be 'stealth' or 'default' )
|
||||
|
||||
async_loading = true, -- Load parts of the theme asyncronously for faster startup (turned on by default)
|
||||
|
||||
custom_colors = nil, -- If you want to everride the default colors, set this to a function
|
||||
|
||||
custom_highlights = {}, -- Overwrite highlights with your own
|
||||
})
|
||||
vim.g.material_style = "darker"
|
||||
vim.cmd('colorscheme material')
|
||||
end,
|
||||
enabled = false
|
||||
}
|
62
lua/plugins/monokai-pro.lua
Normal file
62
lua/plugins/monokai-pro.lua
Normal file
@ -0,0 +1,62 @@
|
||||
return {
|
||||
'loctvl842/monokai-pro.nvim',
|
||||
config = function()
|
||||
require('monokai-pro').setup({
|
||||
-- filter = 'spectrum'
|
||||
override = function(c)
|
||||
return {
|
||||
['@lsp.type.class'] = { link = 'Structure' },
|
||||
['@lsp.type.decorator'] = { link = 'Function' },
|
||||
['@lsp.type.enum'] = { link = 'Structure' },
|
||||
['@lsp.type.enumNumber'] = { link = 'Constant' },
|
||||
['@lsp.type.function'] = { link = 'Function' },
|
||||
['@lsp.type.interface'] = { link = 'Structure' },
|
||||
['@lsp.type.macro'] = { link = 'Macro' },
|
||||
-- ['@lsp.type.method'] = { link = 'Function' },
|
||||
['@lsp.type.namespace'] = { link = 'Identifier' },
|
||||
['@lsp.type.parameter'] = { link = '@lsp.typemod.parameter.declaration' },
|
||||
['@lsp.type.property'] = { link = 'Identifier' },
|
||||
['@lsp.type.struct'] = { link = 'Structure' },
|
||||
['@lsp.type.type'] = { link = 'Type' },
|
||||
['@lsp.type.typeParameter'] = { link = 'TypeDef' },
|
||||
['@lsp.type.variable'] = { link = 'Identifier' },
|
||||
|
||||
-- mod
|
||||
-- ["@lsp.mod.declaration"] = { fg = c.base.cyan },
|
||||
-- ["@lsp.mod.definition"] = { fg = c.base.cyan },
|
||||
-- ["@lsp.mod.readonly"] = { fg = c.base.magenta },
|
||||
-- ["@lsp.mod.static"] = {},
|
||||
['@lsp.mod.deprecated'] = { strikethrough = true },
|
||||
-- ["@lsp.mod.abstract"] = {},
|
||||
-- ["@lsp.mod.async"] = {},
|
||||
-- ["@lsp.mod.modification"] = {},
|
||||
-- ["@lsp.mod.documentation"] = {},
|
||||
-- ["@lsp.mod.defaultLibrary"] = {},
|
||||
|
||||
['@lsp.typemod.class.defaultLibrary'] = { fg = c.base.white },
|
||||
-- ["@lsp.typemod.decorator"] = {},
|
||||
-- ["@lsp.typemod.enum"] = {},
|
||||
-- ["@lsp.typemod.enumNumber"] = {},
|
||||
['@lsp.typemod.function.declaration'] = { fg = c.base.green },
|
||||
['@lsp.typemod.function.defaultLibrary'] = { fg = c.base.blue },
|
||||
-- ["@lsp.typemod.interface"] = {},
|
||||
-- ["@lsp.typemod.macro"] = {},
|
||||
-- ["@lsp.typemod.method"] = {},
|
||||
["@lsp.typemod.namespace"] = { fg = c.base.red },
|
||||
-- ['@lsp.typemod.parameter.declaration'] = { fg = c.base.blue, italic = styles.parameter.italic },
|
||||
["@lsp.typemod.property"] = { fg = '#9699f2' },
|
||||
-- ["@lsp.typemod.struct"] = {},
|
||||
-- ["@lsp.typemod.type"] = {},
|
||||
-- ["@lsp.typemod.typeParameter"] = {},
|
||||
['@lsp.typemod.variable.readonly'] = { fg = c.base.magenta },
|
||||
|
||||
-- ['@lsp.type.parameter'] = { fg = '#797df2' },
|
||||
-- ['@lsp.type.function'] = { fg = '#797df2' },
|
||||
-- ['@lsp.type.method'] = { fg = '#797df2' },
|
||||
['@lsp.mod.readonly'] = { bold = true },
|
||||
}
|
||||
end,
|
||||
})
|
||||
vim.cmd('colorscheme monokai-pro')
|
||||
end
|
||||
}
|
59
lua/plugins/navbuddy.lua
Normal file
59
lua/plugins/navbuddy.lua
Normal file
@ -0,0 +1,59 @@
|
||||
return {
|
||||
'SmiteshP/nvim-navbuddy',
|
||||
dependencies = {
|
||||
'neovim/nvim-lspconfig',
|
||||
'SmiteshP/nvim-navic',
|
||||
'MunifTanjim/nui.nvim'
|
||||
},
|
||||
config = function()
|
||||
local actions = require('nvim-navbuddy.actions')
|
||||
local navbuddy = require('nvim-navbuddy')
|
||||
navbuddy.setup {
|
||||
mappings = {
|
||||
['<esc>'] = actions.close, -- Close and cursor to original location
|
||||
['q'] = actions.close,
|
||||
['j'] = actions.next_sibling, -- down
|
||||
['k'] = actions.previous_sibling, -- up
|
||||
['h'] = actions.parent, -- Move to left panel
|
||||
['l'] = actions.children, -- Move to right panel
|
||||
['v'] = actions.visual_name, -- Visual selection of name
|
||||
['V'] = actions.visual_scope, -- Visual selection of scope
|
||||
['y'] = actions.yank_name, -- Yank the name to system clipboard "+
|
||||
['Y'] = actions.yank_scope, -- Yank the scope to system clipboard "+
|
||||
['i'] = actions.insert_name, -- Insert at start of name
|
||||
['I'] = actions.insert_scope, -- Insert at start of scope
|
||||
['a'] = actions.append_name, -- Insert at end of name
|
||||
['A'] = actions.append_scope, -- Insert at end of scope
|
||||
['r'] = actions.rename, -- Rename currently focused symbol
|
||||
['d'] = actions.delete, -- Delete scope
|
||||
['f'] = actions.fold_create, -- Create fold of current scope
|
||||
['F'] = actions.fold_delete, -- Delete fold of current scope
|
||||
['c'] = actions.comment, -- Comment out current scope
|
||||
['<enter>'] = actions.select, -- Goto selected symbol
|
||||
['o'] = actions.select,
|
||||
['J'] = actions.move_down, -- Move focused node down
|
||||
['K'] = actions.move_up, -- Move focused node up
|
||||
['<down>'] = actions.next_sibling, -- down
|
||||
['<uo>'] = actions.previous_sibling, -- up
|
||||
['<left>'] = actions.parent, -- Move to left panel
|
||||
['<right>'] = actions.children, -- Move to right panel
|
||||
['<S-down>'] = actions.move_down, -- Move focused node down
|
||||
['<S-up>'] = actions.move_up, -- Move focused node up
|
||||
},
|
||||
lsp = {
|
||||
auto_attach = true, -- If set to true, you don't need to manually use attach function
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<Space>n',
|
||||
function()
|
||||
require('nvim-navbuddy').open()
|
||||
end,
|
||||
desc = 'Navbuddy'
|
||||
},
|
||||
},
|
||||
cmd = 'Navbuddy',
|
||||
event = 'LspAttach'
|
||||
}
|
18
lua/plugins/neoclip.lua
Normal file
18
lua/plugins/neoclip.lua
Normal file
@ -0,0 +1,18 @@
|
||||
return {
|
||||
'AckslD/nvim-neoclip.lua',
|
||||
dependencies = {
|
||||
{ 'kkharji/sqlite.lua', module = 'sqlite' },
|
||||
-- { 'nvim-telescope/telescope.nvim' },
|
||||
},
|
||||
config = true,
|
||||
keys = {
|
||||
{
|
||||
'[',
|
||||
function()
|
||||
require('telescope').extensions.neoclip.default({ initial_mode = 'normal' })
|
||||
end,
|
||||
desc = 'NeoClip'
|
||||
}
|
||||
},
|
||||
event = 'VeryLazy'
|
||||
}
|
34
lua/plugins/neogen.lua
Normal file
34
lua/plugins/neogen.lua
Normal file
@ -0,0 +1,34 @@
|
||||
return {
|
||||
'danymat/neogen',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
opts = {
|
||||
enabled = true,
|
||||
languages = {
|
||||
cpp = {
|
||||
template = {
|
||||
annotation_convention = 'custom',
|
||||
custom = {
|
||||
{ nil, '/// file', { no_results = true, type = { 'file' } } },
|
||||
{ nil, '/// $1', { no_results = true, type = { 'func', 'file' } } },
|
||||
{ nil, '', { no_results = true, type = { 'file' } } },
|
||||
|
||||
{ nil, '/// $1', { type = { 'func' } } },
|
||||
{ 'tparam', '/// \\tparam %s $1' },
|
||||
{ 'parameters', '/// \\param %s $1' },
|
||||
{ 'return_statement', '/// \\return $1' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>n',
|
||||
function()
|
||||
require('neogen').generate({})
|
||||
end,
|
||||
desc = 'Add comment',
|
||||
}
|
||||
},
|
||||
cmd = 'Neogen'
|
||||
}
|
40
lua/plugins/neotest.lua
Normal file
40
lua/plugins/neotest.lua
Normal file
@ -0,0 +1,40 @@
|
||||
return {
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'antoinemadec/FixCursorHold.nvim',
|
||||
'nvim-neotest/neotest-python'
|
||||
},
|
||||
config = function()
|
||||
local pythonVenv = require('utils.python_venv')
|
||||
require('neotest').setup({
|
||||
adapters = {
|
||||
require('neotest-python')({
|
||||
dap = {
|
||||
justMyCode = false
|
||||
},
|
||||
args = { '--log-level', 'DEBUG' },
|
||||
runner = 'pytest',
|
||||
python = pythonVenv.getPythonEnv
|
||||
})
|
||||
}
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<F3>',
|
||||
function()
|
||||
require('neotest').run.run()
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
},
|
||||
{
|
||||
'<S-F3>',
|
||||
function()
|
||||
require('neotest').run.run({ strategy = 'dap' })
|
||||
end,
|
||||
desc = 'Run nearest test'
|
||||
}
|
||||
}
|
||||
}
|
63
lua/plugins/neotree.lua
Normal file
63
lua/plugins/neotree.lua
Normal file
@ -0,0 +1,63 @@
|
||||
return {
|
||||
'nvim-neo-tree/neo-tree.nvim',
|
||||
cmd = 'Neotree',
|
||||
keys = {
|
||||
{ '\\', '<cmd>Neotree reveal<cr>', desc = 'NeoTree' },
|
||||
},
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
-- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'MunifTanjim/nui.nvim',
|
||||
},
|
||||
opts = {
|
||||
window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
|
||||
-- possible options. These can also be functions that return these options.
|
||||
position = 'float', -- left, right, float, current
|
||||
width = 40, -- applies to left and right positions
|
||||
popup = { -- settings that apply to float position only
|
||||
size = {
|
||||
height = '80%',
|
||||
width = '50%',
|
||||
},
|
||||
position = '50%', -- 50% means center it
|
||||
-- you can also specify border here, if you want a different setting from
|
||||
-- the global popup_border_style.
|
||||
},
|
||||
enable_git_status = false,
|
||||
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
|
||||
-- You can also create your own commands by providing a function instead of a string.
|
||||
mappings = {
|
||||
['<space>'] = 'toggle_node',
|
||||
['<2-LeftMouse>'] = 'open',
|
||||
['<cr>'] = 'open',
|
||||
['s'] = 'open_split',
|
||||
['v'] = 'open_vsplit',
|
||||
['C'] = 'close_node',
|
||||
['z'] = 'close_all_nodes',
|
||||
['R'] = 'refresh',
|
||||
['a'] = 'add',
|
||||
['A'] = 'add_directory',
|
||||
['d'] = 'delete',
|
||||
['r'] = 'rename',
|
||||
['y'] = 'copy_to_clipboard',
|
||||
['x'] = 'cut_to_clipboard',
|
||||
['p'] = 'paste_from_clipboard',
|
||||
['c'] = 'copy', -- takes text input for destination
|
||||
['m'] = 'move', -- takes text input for destination
|
||||
['q'] = 'close_window',
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
hijack_netrw_behavior = 'disabled',
|
||||
},
|
||||
source_selector = {
|
||||
winbar = true,
|
||||
statusline = false
|
||||
}
|
||||
}
|
||||
}
|
10
lua/plugins/nvim-colorizer.lua
Normal file
10
lua/plugins/nvim-colorizer.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
'NvChad/nvim-colorizer.lua',
|
||||
config = true,
|
||||
cmd = {
|
||||
'ColorizerAttachToBuffer',
|
||||
'ColorizerDetachFromBuffer',
|
||||
'ColorizerReloadAllBuffers',
|
||||
'ColorizerToggle'
|
||||
}
|
||||
}
|
15
lua/plugins/nvim-router.lua
Normal file
15
lua/plugins/nvim-router.lua
Normal file
@ -0,0 +1,15 @@
|
||||
return {
|
||||
'notjedi/nvim-rooter.lua',
|
||||
opts = {
|
||||
rooter_patterns = { '.git',
|
||||
'_darcs',
|
||||
'.hg',
|
||||
'.bzr',
|
||||
'.svn',
|
||||
'Makefile',
|
||||
'package.json',
|
||||
'build_nvim',
|
||||
'real_path.txt',
|
||||
'conaninfo.txt' },
|
||||
}
|
||||
}
|
10
lua/plugins/nvim-surround.lua
Normal file
10
lua/plugins/nvim-surround.lua
Normal file
@ -0,0 +1,10 @@
|
||||
return {
|
||||
'kylechui/nvim-surround',
|
||||
version = '*', -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = 'VeryLazy',
|
||||
config = function()
|
||||
require('nvim-surround').setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
}
|
5
lua/plugins/nvim-ts-rainbow.lua
Normal file
5
lua/plugins/nvim-ts-rainbow.lua
Normal file
@ -0,0 +1,5 @@
|
||||
return {
|
||||
'p00f/nvim-ts-rainbow',
|
||||
dependencies = 'nvim-treesitter/nvim-treesitter',
|
||||
event = 'VeryLazy'
|
||||
}
|
4
lua/plugins/octo.lua
Normal file
4
lua/plugins/octo.lua
Normal file
@ -0,0 +1,4 @@
|
||||
return { 'pwntester/octo.nvim',
|
||||
cmd = 'Octo',
|
||||
config = true,
|
||||
}
|
31
lua/plugins/oil.lua
Normal file
31
lua/plugins/oil.lua
Normal file
@ -0,0 +1,31 @@
|
||||
return {
|
||||
'stevearc/oil.nvim',
|
||||
opts = {
|
||||
keymaps = {
|
||||
['g?'] = 'actions.show_help',
|
||||
['<CR>'] = 'actions.select',
|
||||
['<C-s>'] = 'actions.select_vsplit',
|
||||
['<C-h>'] = 'actions.select_split',
|
||||
['<C-t>'] = 'actions.select_tab',
|
||||
['<C-p>'] = 'actions.preview',
|
||||
['<C-c>'] = 'actions.close',
|
||||
['<C-l>'] = 'actions.refresh',
|
||||
['<backspace>'] = 'actions.parent',
|
||||
['_'] = 'actions.open_cwd',
|
||||
['`'] = 'actions.cd',
|
||||
['~'] = 'actions.tcd',
|
||||
['g.'] = 'actions.toggle_hidden',
|
||||
},
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
keys = {
|
||||
{
|
||||
'-',
|
||||
function()
|
||||
require('oil').open()
|
||||
end,
|
||||
desc = 'Open oil',
|
||||
}
|
||||
}
|
||||
}
|
19
lua/plugins/overseer.lua
Normal file
19
lua/plugins/overseer.lua
Normal file
@ -0,0 +1,19 @@
|
||||
return {
|
||||
'stevearc/overseer.nvim',
|
||||
config = function()
|
||||
require('overseer').setup({
|
||||
templates = { 'builtin', 'user.cmake.cmake' },
|
||||
})
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<f4>',
|
||||
function()
|
||||
require('overseer').open()
|
||||
require('overseer').run_template()
|
||||
end,
|
||||
mode = { 'n', 'x' },
|
||||
desc = 'Start task (overseer)',
|
||||
},
|
||||
}
|
||||
}
|
22
lua/plugins/project.lua
Normal file
22
lua/plugins/project.lua
Normal file
@ -0,0 +1,22 @@
|
||||
return {
|
||||
'ahmedkhalf/project.nvim',
|
||||
config = function()
|
||||
require('project_nvim').setup(
|
||||
{
|
||||
silent_chdir = true,
|
||||
ignore_lsp = { 'null-ls', 'cmake', 'neocmake' },
|
||||
patterns = { '.git', '_darcs', '.hg', '.bzr', '.svn', 'Makefile', 'package.json', 'build_nvim', 'real_path.txt',
|
||||
'conaninfo.txt' },
|
||||
})
|
||||
end,
|
||||
enabled = false,
|
||||
keys = {
|
||||
{
|
||||
'<space>p',
|
||||
function()
|
||||
require('telescope').extensions.projects.projects()
|
||||
end,
|
||||
desc = 'Select project',
|
||||
},
|
||||
}
|
||||
}
|
203
lua/plugins/telescope.lua
Normal file
203
lua/plugins/telescope.lua
Normal file
@ -0,0 +1,203 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'molecule-man/telescope-menufacture',
|
||||
{
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
build = {
|
||||
'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -G Ninja', -- On windows add -DCMAKE_C_FLAGS="-target x86_64-w64-mingw32"
|
||||
'cmake --build build --config Release',
|
||||
'cmake --install build --prefix build'
|
||||
},
|
||||
},
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
'ahmedkhalf/project.nvim',
|
||||
},
|
||||
cmd = { 'Telescope' },
|
||||
keys = {
|
||||
{
|
||||
'<leader>f',
|
||||
function()
|
||||
require('telescope').extensions.menufacture.find_files({ no_ignore = true, hidden = true })
|
||||
end,
|
||||
desc = 'Find file',
|
||||
},
|
||||
{
|
||||
'<leader>c',
|
||||
function()
|
||||
require('telescope.builtin').commands()
|
||||
end,
|
||||
desc = 'Telescope commands',
|
||||
},
|
||||
{
|
||||
'<leader>g',
|
||||
function()
|
||||
Project_files()
|
||||
end,
|
||||
desc = 'Find git files',
|
||||
},
|
||||
{
|
||||
'<leader>o',
|
||||
function()
|
||||
require('telescope.builtin').oldfiles()
|
||||
end,
|
||||
desc = 'Find old files',
|
||||
},
|
||||
{
|
||||
'<leader>b',
|
||||
function()
|
||||
require('telescope.builtin').buffers()
|
||||
end,
|
||||
desc = 'Select buffer',
|
||||
},
|
||||
{
|
||||
'<leader>q',
|
||||
function()
|
||||
require('telescope.builtin').quickfix()
|
||||
end,
|
||||
desc = 'Quickfix list with telescope',
|
||||
},
|
||||
{
|
||||
'<leader>l',
|
||||
function()
|
||||
require('telescope').extensions.menufacture.live_grep()
|
||||
end,
|
||||
desc = 'Search in project',
|
||||
},
|
||||
{
|
||||
'<leader>j',
|
||||
function()
|
||||
require('telescope.builtin').jumplist()
|
||||
end,
|
||||
desc = 'Open jumplist',
|
||||
},
|
||||
{
|
||||
'<c-f>',
|
||||
function()
|
||||
require('telescope.builtin').current_buffer_fuzzy_find()
|
||||
end,
|
||||
desc = 'Find in buffer',
|
||||
},
|
||||
{
|
||||
'<leader>d',
|
||||
function()
|
||||
require('telescope').extensions.menufacture.grep_string()
|
||||
end,
|
||||
desc = 'Find in workspace',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
local mappingTab = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_tab,
|
||||
['<C-b>'] = actions.select_default,
|
||||
},
|
||||
}
|
||||
|
||||
Project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
local ok = pcall(require('telescope').extensions.menufacture.git_files, opts)
|
||||
if not ok then require('telescope').extensions.menufacture.find_files(opts) end
|
||||
end
|
||||
|
||||
|
||||
local telescopeConfig = require('telescope.config')
|
||||
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||
|
||||
-- I want to search in hidden/dot files.
|
||||
table.insert(vimgrep_arguments, '--hidden')
|
||||
-- I don't want to search in the `.git` directory.
|
||||
table.insert(vimgrep_arguments, '--glob')
|
||||
table.insert(vimgrep_arguments, '!**/.git/*')
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_default + actions.center,
|
||||
['<C-l>'] = actions.send_selected_to_loclist,
|
||||
['<C-q>'] = actions.smart_send_to_qflist,
|
||||
},
|
||||
},
|
||||
-- `hidden = true` is not supported in text grep commands.
|
||||
vimgrep_arguments = vimgrep_arguments,
|
||||
},
|
||||
pickers = {
|
||||
-- Your special builtin config goes in here
|
||||
buffers = {
|
||||
sort_lastused = false,
|
||||
sort_mru = true,
|
||||
ignore_current_buffer = true,
|
||||
theme = 'ivy',
|
||||
mappings = {
|
||||
i = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
['<cr>'] = actions.select_default,
|
||||
},
|
||||
n = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
find_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
-- `hidden = true` will still show the inside of `.git/` as it's not `.gitignore`d.
|
||||
find_command = { 'rg', '--files', '--hidden', '--glob', '!**/.git/*' },
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
},
|
||||
git_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
lsp_references = {
|
||||
show_line = false,
|
||||
include_declaration = false,
|
||||
},
|
||||
lsp_dynamic_workspace_symbols = {
|
||||
theme = 'ivy',
|
||||
fname_width = 80,
|
||||
symbol_width = 55,
|
||||
symbol_type_width = 8,
|
||||
ignore_symbols = { 'namespace' }
|
||||
},
|
||||
lsp_document_symbols = {
|
||||
theme = 'ivy',
|
||||
fname_width = 80,
|
||||
symbol_width = 85,
|
||||
symbol_type_width = 8,
|
||||
ignore_symbols = { 'namespace' }
|
||||
},
|
||||
lsp_workspace_symbols = {
|
||||
fname_width = 30,
|
||||
symbol_width = 85,
|
||||
symbol_type_width = 8,
|
||||
ignore_symbols = { 'namespace' }
|
||||
},
|
||||
},
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
require('telescope.themes').get_dropdown {
|
||||
}
|
||||
},
|
||||
['menufacture'] = {
|
||||
mappings = {
|
||||
main_menu = { [{ 'n' }] = 'm' },
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
require('telescope').load_extension('ui-select')
|
||||
require('telescope').load_extension('fzf')
|
||||
require('telescope').load_extension('menufacture')
|
||||
end
|
||||
}
|
24
lua/plugins/toggleterm.lua
Normal file
24
lua/plugins/toggleterm.lua
Normal file
@ -0,0 +1,24 @@
|
||||
return {
|
||||
'akinsho/toggleterm.nvim',
|
||||
config = function()
|
||||
function _G.set_terminal_keymaps(term)
|
||||
local opts = { noremap = true }
|
||||
if (term.cmd ~= 'lazygit') then
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
end
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
require('toggleterm').setup({
|
||||
on_open = set_terminal_keymaps
|
||||
})
|
||||
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
|
||||
end,
|
||||
cmd = 'ToggleTerm',
|
||||
}
|
49
lua/plugins/treesitter.lua
Normal file
49
lua/plugins/treesitter.lua
Normal file
@ -0,0 +1,49 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = 'all',
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
-- colors = {}, -- table of hex strings
|
||||
-- termcolors = {} -- table of colour name strings
|
||||
},
|
||||
indent = {
|
||||
enable = false -- maybe buggy
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
['af'] = '@function.outer',
|
||||
['if'] = '@function.inner',
|
||||
['ac'] = '@class.outer',
|
||||
['ic'] = '@class.inner',
|
||||
},
|
||||
},
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'none',
|
||||
peek_definition_code = {
|
||||
['<leader>df'] = '@function.outer',
|
||||
['<leader>dF'] = '@class.outer',
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
|
||||
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
||||
require('nvim-treesitter.install').prefer_git = true
|
||||
end
|
||||
}
|
12
lua/plugins/which-key.lua
Normal file
12
lua/plugins/which-key.lua
Normal file
@ -0,0 +1,12 @@
|
||||
return {
|
||||
'folke/which-key.nvim',
|
||||
opts = {
|
||||
plugins = {
|
||||
marks = false,
|
||||
registers = false,
|
||||
presets = {
|
||||
operators = false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
require('aerial').setup({
|
||||
backends = { 'lsp', 'treesitter','markdown' },
|
||||
default_direction = "prefer_left",
|
||||
filter_kind = false,
|
||||
show_guides = true,
|
||||
})
|
@ -1,10 +0,0 @@
|
||||
local opt = vim.opt -- to set options
|
||||
-- require('telescope').load_extension('cmake')
|
||||
require('cmake').setup({
|
||||
parameters_file = 'neovim.json', -- JSON file to store information about selected target, run arguments and build type.
|
||||
build_dir = '{cwd}/build_nvim', -- Build directory. The expressions `{cwd}`, `{os}` and `{build_type}` will be expanded with the corresponding text values.
|
||||
})
|
||||
-- msbuild errorformat
|
||||
opt.errorformat:append('\\ %#%f(%l\\\\\\,%c):\\ %m')
|
||||
-- cl.exe errorformat
|
||||
-- o.errorformat:append('\ %#%f(%l) : %#%t%[A-z]%# %m')
|
@ -1,139 +0,0 @@
|
||||
local cmp = require('cmp')
|
||||
local luasnip = require('luasnip')
|
||||
|
||||
local t = function(str)
|
||||
return vim.api.nvim_replace_termcodes(str, true, true, true)
|
||||
end
|
||||
|
||||
local check_back_space = function()
|
||||
local col = vim.fn.col('.') - 1
|
||||
return col == 0 or vim.fn.getline('.'):sub(col, col):match('%s') ~= nil
|
||||
end
|
||||
|
||||
cmp.setup({
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
-- fancy icons and a name of kind
|
||||
vim_item.kind = require('lspkind').presets.default[vim_item.kind] .. ' ' .. vim_item.kind
|
||||
-- set a name for each source
|
||||
vim_item.menu = ({
|
||||
buffer = '[Buffer]',
|
||||
nvim_lsp = '[LSP]',
|
||||
ultisnips = '[UltiSnips]',
|
||||
nvim_lua = '[Lua]',
|
||||
cmp_tabnine = '[TabNine]',
|
||||
look = '[Look]',
|
||||
path = '[Path]',
|
||||
spell = '[Spell]',
|
||||
calc = '[Calc]',
|
||||
emoji = '[Emoji]',
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<Up>'] = cmp.mapping(cmp.mapping.select_prev_item(), { 'i', 'c', 's' }),
|
||||
['<Down>'] = cmp.mapping(cmp.mapping.select_next_item(), { 'i', 'c', 's' }),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c', 's' }),
|
||||
['<C-e>'] = cmp.mapping(cmp.mapping.close(), { 'i', 'c', 's' }),
|
||||
['<CR>'] = cmp.mapping({
|
||||
i = cmp.mapping.confirm({ behavior = cmp.ConfirmBehavior.Insert, select = true }),
|
||||
c = cmp.mapping.confirm({ select = false }),
|
||||
s = cmp.mapping.confirm({ select = false }),
|
||||
}),
|
||||
['<Tab>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.expand_or_jumpable() then
|
||||
vim.api.nvim_feedkeys(t('<Plug>luasnip-expand-or-jump'), '', true)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
'i',
|
||||
's',
|
||||
}),
|
||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
||||
if luasnip.jumpable(-1) then
|
||||
vim.api.nvim_feedkeys(t('<Plug>luasnip-jump-prev'), '', true)
|
||||
else
|
||||
fallback()
|
||||
end
|
||||
end, {
|
||||
'i',
|
||||
's',
|
||||
}),
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = {
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lsp_signature_help' },
|
||||
{ name = 'treesitter' },
|
||||
{ name = 'buffer' },
|
||||
-- { name = 'nvim_lua' },
|
||||
-- { name = 'look' },
|
||||
-- { name = 'path' },
|
||||
-- { name = 'cmp_tabnine' },
|
||||
-- { name = 'calc' },
|
||||
-- { name = 'spell' },
|
||||
-- { name = 'emoji' },
|
||||
},
|
||||
completion = { completeopt = 'menu,menuone,noinsert, noselect' },
|
||||
sorting = {
|
||||
comparators = {
|
||||
cmp.config.compare.offset,
|
||||
cmp.config.compare.exact,
|
||||
require('clangd_extensions.cmp_scores'),
|
||||
cmp.config.compare.recently_used,
|
||||
cmp.config.compare.kind,
|
||||
cmp.config.compare.sort_text,
|
||||
cmp.config.compare.length,
|
||||
cmp.config.compare.order,
|
||||
},
|
||||
},
|
||||
-- experimental = { native_menu = true }
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' },
|
||||
}, {
|
||||
{ name = 'cmdline' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
})
|
||||
|
||||
-- Autopairs
|
||||
--require("nvim-autopairs.completion.cmp").setup({
|
||||
-- map_cr = true,
|
||||
-- map_complete = true,
|
||||
-- auto_select = true
|
||||
--})
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
|
||||
|
||||
-- TabNine
|
||||
--local tabnine = require('cmp_tabnine.config')
|
||||
--tabnine:setup({max_lines = 1000, max_num_results = 20, sort = true})
|
||||
|
||||
-- Database completion
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
autocmd FileType sql,mysql,plsql lua require('cmp').setup.buffer({ sources = {{ name = 'vim-dadbod-completion' }} })
|
||||
]],
|
||||
false
|
||||
)
|
@ -1,3 +0,0 @@
|
||||
require('Comment').setup({
|
||||
mappings = false,
|
||||
})
|
@ -1,9 +0,0 @@
|
||||
require('gitsigns').setup({
|
||||
current_line_blame = false,
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
})
|
@ -1,14 +0,0 @@
|
||||
require('gruvbox').setup({
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = false,
|
||||
italic = false, -- will make italic comments and special strings
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
contrast = "hard", -- can be "hard" or "soft"
|
||||
overrides = {},
|
||||
})
|
||||
vim.cmd('colorscheme gruvbox')
|
@ -1,12 +0,0 @@
|
||||
local opt = vim.opt -- to set options
|
||||
opt.listchars:append('eol:↴')
|
||||
-- opt.listchars:append("space: ")
|
||||
opt.listchars:append('trail: ')
|
||||
opt.listchars:append('tab:→ ')
|
||||
|
||||
require('indent_blankline').setup({
|
||||
show_end_of_line = true,
|
||||
use_treesitter = true,
|
||||
show_current_context = true,
|
||||
context_patterns = { 'class', 'function', 'method', 'block', '^if', '^for', '^while' },
|
||||
})
|
@ -1,192 +0,0 @@
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' }
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities.textDocument.completion.completionItem.preselectSupport = true
|
||||
capabilities.textDocument.completion.completionItem.insertReplaceSupport = true
|
||||
capabilities.textDocument.completion.completionItem.labelDetailsSupport = true
|
||||
capabilities.textDocument.completion.completionItem.deprecatedSupport = true
|
||||
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
|
||||
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
|
||||
capabilities.offsetEncoding = { 'utf-16' }
|
||||
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
||||
properties = {
|
||||
'documentation',
|
||||
'detail',
|
||||
'additionalTextEdits',
|
||||
},
|
||||
}
|
||||
|
||||
OpenDiagFloat = function()
|
||||
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||
if vim.api.nvim_win_get_config(winid).zindex then
|
||||
return
|
||||
end
|
||||
end
|
||||
vim.diagnostic.open_float({ focusable = false })
|
||||
end
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_option(0, 'formatexpr', 'v:lua.vim.lsp.formatexpr()')
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap = true, silent = false, buffer = true }
|
||||
vim.keymap.set('n', '<space>,', vim.lsp.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', '<space>;', vim.lsp.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>a', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', '<space>d', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<space>e', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', '<space>h', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls, opts)
|
||||
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls, opts)
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename, opts)
|
||||
local tele_builtins = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<C-t>', tele_builtins.lsp_dynamic_workspace_symbols, opts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<space>r', tele_builtins.lsp_references, opts)
|
||||
vim.keymap.set('n', '<A-m>', '<cmd>Telescope aerial<cr>', opts)
|
||||
vim.keymap.set('n', '<space>v', function() tele_builtins.diagnostics({ bufnr = 0 }) end, opts)
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>', opts)
|
||||
|
||||
vim.cmd([[autocmd CursorHold <buffer> lua OpenDiagFloat()]])
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.keymap.set('v', '<space>f', vim.lsp.buf.range_formatting, opts)
|
||||
end
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.server_capabilities.documentHighlightProvider then
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
hi LspReferenceRead cterm=bold ctermbg=red guibg=DarkGreen
|
||||
hi LspReferenceWrite cterm=bold ctermbg=red guibg=DarkRed
|
||||
]], false)
|
||||
vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true })
|
||||
vim.api.nvim_clear_autocmds { buffer = bufnr, group = "lsp_document_highlight" }
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
buffer = bufnr,
|
||||
group = "lsp_document_highlight",
|
||||
desc = "Document Highlight",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
buffer = bufnr,
|
||||
group = "lsp_document_highlight",
|
||||
desc = "Clear All the References",
|
||||
})
|
||||
end
|
||||
|
||||
require('lsp_signature').on_attach({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = 'single',
|
||||
},
|
||||
hi_parameter = 'IncSearch',
|
||||
}, bufnr)
|
||||
require("aerial").on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
local lsp_installer = require('nvim-lsp-installer')
|
||||
|
||||
local servers = {
|
||||
'pyright',
|
||||
'cmake',
|
||||
'clangd',
|
||||
'jsonls',
|
||||
'sumneko_lua',
|
||||
'dockerls',
|
||||
}
|
||||
|
||||
for _, name in pairs(servers) do
|
||||
local server_is_found, server = lsp_installer.get_server(name)
|
||||
if server_is_found then
|
||||
if not server:is_installed() then
|
||||
print('Installing ' .. name)
|
||||
server:install()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
lsp_installer.on_server_ready(function(server)
|
||||
local opts = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
}
|
||||
|
||||
-- (optional) Customize the options passed to the server
|
||||
if server.name == 'clangd' then
|
||||
return
|
||||
end
|
||||
|
||||
if server.name == 'sumneko_lua' then
|
||||
local lua_rtp = vim.split(package.path, ';')
|
||||
table.insert(lua_rtp, 'lua/?.lua')
|
||||
table.insert(lua_rtp, 'lua/?/init.lua')
|
||||
opts.settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = lua_rtp,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim', 'use' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
end
|
||||
if server.name == 'yamlls' then
|
||||
opts.settings = {
|
||||
yaml = {
|
||||
validate = false
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
-- This setup() function is exactly the same as lspconfig's setup function (:help lspconfig-quickstart)
|
||||
server:setup(opts)
|
||||
vim.cmd([[ do User LspAttachBuffers ]])
|
||||
end)
|
||||
|
||||
local null_ls = require('null-ls')
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.cmake_format,
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
vim.diagnostic.config({ virtual_text = false })
|
||||
|
||||
require('clangd_extensions').setup({
|
||||
server = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
||||
},
|
||||
})
|
@ -1,34 +0,0 @@
|
||||
if vim.version().minor >= 8 then
|
||||
local function status_line()
|
||||
local file_name = "%-.32t"
|
||||
local modified = " %-m"
|
||||
local right_align = "%="
|
||||
local line_no = "%10([%l/%L%)]"
|
||||
local pct_thru_file = "%5p%%"
|
||||
|
||||
return string.format(
|
||||
"%s%s%s%s%s",
|
||||
file_name,
|
||||
modified,
|
||||
right_align,
|
||||
line_no,
|
||||
pct_thru_file
|
||||
)
|
||||
end
|
||||
|
||||
vim.opt.laststatus = 3
|
||||
vim.opt.winbar = status_line()
|
||||
require('lualine').setup({
|
||||
options = { theme = 'gruvbox-baby' },
|
||||
sections = { lualine_c = { 'getcwd' } },
|
||||
inactive_sections = { lualine_c = { 'getcwd', { 'filename', path = 1, file_status = true } } },
|
||||
globalstatus = true,
|
||||
})
|
||||
else
|
||||
require('lualine').setup({
|
||||
options = { theme = 'gruvbox-baby' },
|
||||
sections = { lualine_c = { 'filename' } },
|
||||
globalstatus = false,
|
||||
-- inactive_sections = { lualine_c = { 'filename' } },
|
||||
})
|
||||
end
|
@ -1,57 +0,0 @@
|
||||
local ls = require('luasnip')
|
||||
-- some shorthands...
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local isn = ls.indent_snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local c = ls.choice_node
|
||||
local d = ls.dynamic_node
|
||||
local r = ls.restore_node
|
||||
local l = require('luasnip.extras').lambda
|
||||
local rep = require('luasnip.extras').rep
|
||||
local p = require('luasnip.extras').partial
|
||||
local m = require('luasnip.extras').match
|
||||
local n = require('luasnip.extras').nonempty
|
||||
local dl = require('luasnip.extras').dynamic_lambda
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local types = require('luasnip.util.types')
|
||||
local conds = require('luasnip.extras.expand_conditions')
|
||||
|
||||
local function getRegA(capitalize)
|
||||
local clipboard = vim.fn.getreg('a')
|
||||
clipboard = clipboard:gsub('^m_', '')
|
||||
if capitalize then
|
||||
clipboard = clipboard:gsub('^%l', string.upper)
|
||||
end
|
||||
return clipboard
|
||||
end
|
||||
|
||||
|
||||
ls.snippets = {
|
||||
cpp = {
|
||||
s('TEST_F_getset',
|
||||
{
|
||||
t('TEST_F('), i(1, 'TestClass'), t(' ,test_'), p(getRegA, false), t({'_set_get)', '{', ' '}),
|
||||
i(2, 'm_object'), t('.set'), p(getRegA, true), t('('), i(3, '32.F'), t({');', ' '}),
|
||||
i(4, 'EXPECT_EQ('), rep(3), t(', '), rep(2), t('.get'), p(getRegA, true), t({'());', ''}),
|
||||
t({'','}', ''})
|
||||
}),
|
||||
s('TEST_fn_getset',
|
||||
{
|
||||
t('void '), p(getRegA, false), t('_'), i(1, 'get'), t('_'), i(2, 'set'), t({'()', '{', ' '}),
|
||||
i(3, 'm_object'), t('.set'), p(getRegA, true), t('('), i(4, '32.F'), t({');', ' '}),
|
||||
i(5, 'EXPECT_EQ('), rep(4), t(', '), rep(3), t('.get'), p(getRegA, true), t({'());', ''}),
|
||||
t({'','}', '', ''}),
|
||||
|
||||
t('TEST_F('), i(5), t(' ,test_'), p(getRegA, false), t({'_set_get)', '{', ' '}),
|
||||
p(getRegA, false), t('_'), rep(1), t('_'), rep(2), t({'();'}),
|
||||
t({'','}'}),
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require('luasnip.loaders.from_vscode').lazy_load({ paths = { "./my-snippets" } })
|
@ -1,249 +0,0 @@
|
||||
require('telescope').load_extension('command_center')
|
||||
|
||||
local command_center = require('command_center')
|
||||
local noremap = { noremap = true }
|
||||
local silent_noremap = { noremap = true, silent = true }
|
||||
|
||||
project_files = function()
|
||||
local opts = {} -- define here if you want to define something
|
||||
local ok = pcall(require"telescope.builtin".git_files, opts)
|
||||
if not ok then require"telescope.builtin".find_files(opts) end
|
||||
end
|
||||
|
||||
command_center.add({
|
||||
{
|
||||
description = 'Open command_center',
|
||||
cmd = '<CMD>Telescope command_center<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<Leader>p', noremap },
|
||||
{ 'x', '<Leader>p', noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open a new tab',
|
||||
cmd = '<CMD>tabnew .<CR>',
|
||||
keybindings = {
|
||||
{ 'n', 'F2', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open a new vertical split',
|
||||
cmd = '<CMD>vsplit .<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<C-F2>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open a new horizontal split',
|
||||
cmd = '<CMD>split .<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<S-F2>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'CMake build all',
|
||||
cmd = '<CMD>CMake build_all<CR>',
|
||||
},
|
||||
{
|
||||
description = 'CMake build selected target',
|
||||
cmd = '<CMD>CMake build<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<F4>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'CMake configure',
|
||||
cmd = '<CMD>CMake configure<CR>',
|
||||
},
|
||||
{
|
||||
description = 'CMake select target',
|
||||
cmd = '<CMD>CMake select_target<CR>',
|
||||
},
|
||||
{
|
||||
description = 'CMake clear cache',
|
||||
cmd = '<CMD>CMake clear_cache<CR>',
|
||||
},
|
||||
{
|
||||
description = 'List snippets',
|
||||
cmd = '<CMD>LuaSnipListAvailable<CR>',
|
||||
},
|
||||
{
|
||||
description = 'Add comment',
|
||||
cmd = '<CMD>Neogen<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>n', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Select project',
|
||||
cmd = '<CMD>Telescope projects<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<space>p', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Find file',
|
||||
cmd = '<CMD>lua require("telescope.builtin").find_files({no_ignore=true})<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>f', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Find git files',
|
||||
cmd = '<CMD>lua project_files()<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>g', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Find old files',
|
||||
cmd = '<CMD>Telescope oldfiles<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>o', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open command history',
|
||||
cmd = '<CMD>Telescope command_history<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>h', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Select buffer',
|
||||
cmd = '<CMD>Telescope buffers<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>b', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Quickfix list with telescope',
|
||||
cmd = '<CMD>Telescope quickfix<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>q', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Search in project',
|
||||
cmd = '<CMD>Telescope live_grep<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>l', silent_noremap },
|
||||
{ 'n', '<c-s-f>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Search in open files',
|
||||
cmd = "<CMD>lua require('telescope.builtin').live_grep({ prompt_title = 'find string in open buffers...', grep_open_files = true })<CR>",
|
||||
},
|
||||
{
|
||||
description = 'Open clipboard history',
|
||||
cmd = '<CMD>Telescope neoclip<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<C-y>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open jumplist',
|
||||
cmd = '<CMD>Telescope jumplist<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>j', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Find in buffer',
|
||||
cmd = '<CMD>Telescope current_buffer_fuzzy_find<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<c-f>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Find in workspace',
|
||||
cmd = '<CMD>Telescope grep_string<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>d', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Open lazygit',
|
||||
cmd = '<CMD>lua _lazygit_toggle()<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<Space>g', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Word under cursor into register a',
|
||||
cmd = '"ayiw',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>a', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Toggle fold',
|
||||
cmd = 'za',
|
||||
keybindings = {
|
||||
{ 'n', '<space>x', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Yanky cycle forward',
|
||||
cmd = '<Plug>(YankyCycleForward)',
|
||||
keybindings = {
|
||||
{ 'n', '<c-n>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Yanky cycle backward',
|
||||
cmd = '<Plug>(YankyCycleBackward)',
|
||||
keybindings = {
|
||||
{ 'n', '<c-p>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Github list PRs',
|
||||
cmd = '<CMD>Octo pr list<CR>',
|
||||
},
|
||||
{
|
||||
description = 'Github checkout PR',
|
||||
cmd = '<CMD>Octo pr checkout<CR>',
|
||||
},
|
||||
{
|
||||
description = 'Github open PR in browser',
|
||||
cmd = '<CMD>Octo pr browser<CR>',
|
||||
},
|
||||
{
|
||||
description = 'Comment line',
|
||||
cmd = '<Plug>(comment_toggle_current_linewise)',
|
||||
keybindings = {
|
||||
{ 'n', '<c-_>', silent_noremap },
|
||||
{ 'n', '<c-c>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Comment line',
|
||||
cmd = '<Plug>(comment_toggle_linewise_visual)gv',
|
||||
keybindings = {
|
||||
{ 'x', '<c-_>', silent_noremap },
|
||||
{ 'x', '<c-c>', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Symbols outline',
|
||||
cmd = '<CMD>AerialToggle<CR>',
|
||||
keybindings = {
|
||||
{ 'n', '<leader>s', silent_noremap },
|
||||
{ 'n', '<Space>s', silent_noremap },
|
||||
},
|
||||
},
|
||||
{
|
||||
description = 'Big font size',
|
||||
cmd = '<CMD>set guifont=JetBrainsMonoNL\\ NF:h12<CR>',
|
||||
},
|
||||
{
|
||||
description = 'Reset font size',
|
||||
cmd = '<CMD>set guifont=JetBrainsMonoNL\\ NF:h9<CR>',
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
@ -1,153 +0,0 @@
|
||||
dap = require('dap')
|
||||
local opts = { noremap = true, silent = false }
|
||||
-- vim.keymap.set('n', '<F5>', dap.continue(), opts)
|
||||
vim.keymap.set('n', '<F5>', ":lua require('dap').continue()<CR>", opts)
|
||||
vim.keymap.set('n', '<F9>', ":lua require('dap').toggle_breakpoint()<CR>", opts)
|
||||
vim.keymap.set('n', '<F10>', ":lua require('dap').step_over()<CR>", opts)
|
||||
vim.keymap.set('n', '<F11>', ":lua require('dap').step_into()<CR>", opts)
|
||||
vim.keymap.set('n', '<S-F11>', ":lua require('dap').step_out()<CR>", opts)
|
||||
|
||||
local initDir = vim.api.nvim_list_runtime_paths()[1]
|
||||
local masonpath = vim.fn.stdpath('data') .. '/mason'
|
||||
|
||||
-- PYTHON
|
||||
local function getVenvSuffix()
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return 'bin/python'
|
||||
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
return 'Scripts/python.exe'
|
||||
end
|
||||
end
|
||||
|
||||
dap.adapters.python = {
|
||||
type = 'executable';
|
||||
command = masonpath .. '/packages/debugpy/venv/' .. getVenvSuffix();
|
||||
args = { '-m', 'debugpy.adapter' };
|
||||
options = {
|
||||
detached = true;
|
||||
};
|
||||
}
|
||||
|
||||
local dap, dapui = require("dap"), require("dapui")
|
||||
dap.listeners.after.event_initialized["dapui_config"] = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited["dapui_config"] = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
local function getPythonEnv()
|
||||
local venv = os.getenv("VIRTUAL_ENV")
|
||||
if venv ~= nil then
|
||||
return string.format("%s\\bin\\python.exe", venv)
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
if vim.fn.executable(cwd .. '/venv/' .. getVenvSuffix()) == 1 then
|
||||
return cwd .. '/venv/' .. getVenvSuffix()
|
||||
elseif vim.fn.executable(cwd .. '/.venv/' .. getVenvSuffix()) == 1 then
|
||||
return cwd .. '/.venv/' .. getVenvSuffix()
|
||||
else
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return '/usr/bin/python'
|
||||
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
return os.getenv('SCOOP') .. '/apps/python/current/python.exe'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
dap.configurations.python = {
|
||||
{
|
||||
type = 'python';
|
||||
request = 'launch';
|
||||
name = "Launch file with venv";
|
||||
justMyCode = false;
|
||||
program = "${file}";
|
||||
pythonPath = getPythonEnv
|
||||
},
|
||||
}
|
||||
|
||||
-- require('dap-python').setup('C:\\Users\\oli\\AppData\\Local\\nvim\\venv_debugpy\\Scripts\\python')
|
||||
-- table.insert(require('dap').configurations.python, {
|
||||
-- -- type = 'python',
|
||||
-- -- request = 'launch',
|
||||
-- -- name = 'My custom launch configuration',
|
||||
-- -- program = '${file}',
|
||||
-- justMyCode = false
|
||||
-- -- ... more options, see https://github.com/microsoft/debugpy/wiki/Debug-configuration-settings
|
||||
-- })
|
||||
-- require('dap-python').setup('C:/Users/oli/AppData/Local/nvim-data/mason/packages/debugpy/venv/Scripts/python.exe')
|
||||
|
||||
-- CPP
|
||||
dap.adapters.codelldb = {
|
||||
type = 'server',
|
||||
port = "${port}",
|
||||
executable = {
|
||||
-- CHANGE THIS to your path!
|
||||
command = masonpath .. '/bin/codelldb.cmd',
|
||||
args = { '--port', '${port}' },
|
||||
|
||||
-- On windows you may have to uncomment this:
|
||||
detached = false,
|
||||
}
|
||||
}
|
||||
|
||||
dap.adapters.lldb = {
|
||||
type = 'executable',
|
||||
command = os.getenv('SCOOP') .. '/apps/llvm/current/bin/lldb-vscode.exe',
|
||||
name = 'lldb'
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = "Launch codelldb",
|
||||
type = "codelldb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = true,
|
||||
},
|
||||
}
|
||||
|
||||
dap.configurations.cpp = {
|
||||
{
|
||||
name = 'Launch lldb',
|
||||
type = 'lldb',
|
||||
request = 'launch',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/build_nvim', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}',
|
||||
stopOnEntry = false,
|
||||
args = {},
|
||||
|
||||
-- 💀
|
||||
-- if you change `runInTerminal` to true, you might need to change the yama/ptrace_scope setting:
|
||||
--
|
||||
-- echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
|
||||
--
|
||||
-- Otherwise you might get the following error:
|
||||
--
|
||||
-- Error on launch: Failed to attach to the target process
|
||||
--
|
||||
-- But you should be aware of the implications:
|
||||
-- https://www.kernel.org/doc/html/latest/admin-guide/LSM/Yama.html
|
||||
-- runInTerminal = false,
|
||||
},
|
||||
}
|
||||
|
||||
-- EXTENSIONS
|
||||
|
||||
require("nvim-dap-virtual-text").setup()
|
||||
require('telescope').load_extension('dap')
|
||||
-- require("cmp").setup.filetype({ "dap-repl", "dapui_watches" }, {
|
||||
-- sources = {
|
||||
-- { name = "dap" },
|
||||
-- },
|
||||
-- })
|
||||
require("dapui").setup()
|
@ -1,3 +0,0 @@
|
||||
local actions = require("diffview.actions")
|
||||
|
||||
require("diffview").setup({})
|
@ -1,4 +0,0 @@
|
||||
vim.g.gruvbox_baby_telescope_theme = 1
|
||||
local colors = require("gruvbox-baby.colors").config()
|
||||
vim.g.gruvbox_baby_highlights = {Visual = {bg = '#384741'}}
|
||||
vim.cmd[[colorscheme gruvbox-baby]]
|
@ -1,5 +0,0 @@
|
||||
vim.g.gruvbox_material_background = 'hard'
|
||||
vim.g.gruvbox_material_foreground = 'original'
|
||||
vim.g.gruvbox_material_cursor = 'purple'
|
||||
vim.g.gruvbox_material_diagnostic_virtual_text = 'colored'
|
||||
vim.cmd('colorscheme gruvbox-material')
|
@ -1 +0,0 @@
|
||||
require('hlargs').setup()
|
@ -1 +0,0 @@
|
||||
require('leap').set_default_keymaps()
|
@ -1,55 +0,0 @@
|
||||
-- configure the litee.nvim library
|
||||
require('litee.lib').setup({
|
||||
tree = {
|
||||
icon_set = "codicons"
|
||||
},
|
||||
panel = {
|
||||
orientation = "left",
|
||||
panel_size = 30
|
||||
}
|
||||
})
|
||||
-- configure litee-calltree.nvim
|
||||
require('litee.calltree').setup({
|
||||
map_resize_keys = false,
|
||||
on_open = 'panel',
|
||||
keymaps = {
|
||||
expand = "<space>",
|
||||
collapse = "zc",
|
||||
collapse_all = "zM",
|
||||
jump = "<CR>",
|
||||
jump_split = "s",
|
||||
jump_vsplit = "v",
|
||||
jump_tab = "t",
|
||||
hover = "i",
|
||||
details = "d",
|
||||
close = "X",
|
||||
close_panel_pop_out = "<Esc>",
|
||||
help = "?",
|
||||
hide = "H",
|
||||
switch = "S",
|
||||
focus = "f"
|
||||
},
|
||||
})
|
||||
-- configure litee-symboltree.nvim
|
||||
require('litee.symboltree').setup({
|
||||
map_resize_keys = false,
|
||||
on_open = 'panel',
|
||||
keymaps = {
|
||||
expand = '<space>',
|
||||
collapse = 'zc',
|
||||
collapse_all = 'zM',
|
||||
jump = '<CR>',
|
||||
jump_split = 's',
|
||||
jump_vsplit = 'v',
|
||||
jump_tab = 't',
|
||||
hover = 'i',
|
||||
details = 'd',
|
||||
close = 'X',
|
||||
close_panel_pop_out = '<Esc>',
|
||||
help = '?',
|
||||
hide = 'H',
|
||||
},
|
||||
})
|
||||
|
||||
require('litee.gh').setup({})
|
||||
|
@ -1,201 +0,0 @@
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.documentationFormat = { 'markdown', 'plaintext' }
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
capabilities.textDocument.completion.completionItem.preselectSupport = true
|
||||
capabilities.textDocument.completion.completionItem.insertReplaceSupport = true
|
||||
capabilities.textDocument.completion.completionItem.labelDetailsSupport = true
|
||||
capabilities.textDocument.completion.completionItem.deprecatedSupport = true
|
||||
capabilities.textDocument.completion.completionItem.commitCharactersSupport = true
|
||||
capabilities.textDocument.completion.completionItem.tagSupport = { valueSet = { 1 } }
|
||||
capabilities.offsetEncoding = { 'utf-16' }
|
||||
capabilities.textDocument.completion.completionItem.resolveSupport = {
|
||||
properties = {
|
||||
'documentation',
|
||||
'detail',
|
||||
'additionalTextEdits',
|
||||
},
|
||||
}
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
|
||||
OpenDiagFloat = function()
|
||||
for _, winid in pairs(vim.api.nvim_tabpage_list_wins(0)) do
|
||||
if vim.api.nvim_win_get_config(winid).zindex then
|
||||
return
|
||||
end
|
||||
end
|
||||
vim.diagnostic.open_float({ focusable = false })
|
||||
end
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local function buf_set_option(...)
|
||||
vim.api.nvim_buf_set_option(bufnr, ...)
|
||||
end
|
||||
|
||||
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_option(0, 'formatexpr', 'v:lua.vim.lsp.formatexpr()')
|
||||
|
||||
-- Mappings.
|
||||
local opts = { noremap = true, silent = false, buffer = bufnr }
|
||||
vim.keymap.set('n', '<space>,', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', '<space>;', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>a', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', '<space>d', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<space>e', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', '<space>h', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<space>c', vim.lsp.buf.outgoing_calls, opts)
|
||||
vim.keymap.set('n', '<space>C', vim.lsp.buf.incoming_calls, opts)
|
||||
vim.keymap.set('n', '<space>m', vim.lsp.buf.rename, opts)
|
||||
local tele_builtins = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<C-t>', tele_builtins.lsp_dynamic_workspace_symbols, opts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
vim.keymap.set('n', '<space>r', tele_builtins.lsp_references, opts)
|
||||
vim.keymap.set('n', '<A-m>', '<cmd>Telescope aerial<cr>', opts)
|
||||
vim.keymap.set('n', '<space>v', function() tele_builtins.diagnostics({ bufnr = 0 }) end, opts)
|
||||
vim.keymap.set('n', '<A-o>', '<cmd>ClangdSwitchSourceHeader<CR>', opts)
|
||||
|
||||
vim.cmd([[autocmd CursorHold <buffer> lua OpenDiagFloat()]])
|
||||
|
||||
-- Set some keybinds conditional on server capabilities
|
||||
if client.server_capabilities.documentFormattingProvider then
|
||||
if vim.version().minor >= 8 then
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.format, opts)
|
||||
else
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, opts)
|
||||
end
|
||||
end
|
||||
if client.server_capabilities.documentRangeFormattingProvider then
|
||||
vim.keymap.set('v', '<space>f', vim.lsp.buf.range_formatting, opts)
|
||||
end
|
||||
|
||||
-- Set autocommands conditional on server_capabilities
|
||||
if client.server_capabilities.documentHighlightProvider then
|
||||
vim.api.nvim_exec(
|
||||
[[
|
||||
hi LspReferenceRead cterm=bold ctermbg=red guibg=DarkGreen
|
||||
hi LspReferenceWrite cterm=bold ctermbg=red guibg=DarkRed
|
||||
]], false)
|
||||
vim.api.nvim_create_augroup("lsp_document_highlight", { clear = true })
|
||||
vim.api.nvim_clear_autocmds { buffer = bufnr, group = "lsp_document_highlight" }
|
||||
vim.api.nvim_create_autocmd("CursorHold", {
|
||||
callback = vim.lsp.buf.document_highlight,
|
||||
buffer = bufnr,
|
||||
group = "lsp_document_highlight",
|
||||
desc = "Document Highlight",
|
||||
})
|
||||
vim.api.nvim_create_autocmd("CursorMoved", {
|
||||
callback = vim.lsp.buf.clear_references,
|
||||
buffer = bufnr,
|
||||
group = "lsp_document_highlight",
|
||||
desc = "Clear All the References",
|
||||
})
|
||||
end
|
||||
|
||||
require('lsp_signature').on_attach({
|
||||
bind = true, -- This is mandatory, otherwise border config won't get registered.
|
||||
handler_opts = {
|
||||
border = 'single',
|
||||
},
|
||||
hi_parameter = 'IncSearch',
|
||||
}, bufnr)
|
||||
require("aerial").on_attach(client, bufnr)
|
||||
end
|
||||
|
||||
require('lspconfig')['pyright'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
require('lspconfig')['groovyls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
require('lspconfig')['cmake'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
require('lspconfig')['clangd'].setup{
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
||||
}
|
||||
-- require('clangd_extensions').setup({
|
||||
-- server = {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- cmd = { 'clangd', '--compile-commands-dir=build_nvim' },
|
||||
-- },
|
||||
-- })
|
||||
|
||||
require('lspconfig')['jsonls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
local lua_rtp = vim.split(package.path, ';')
|
||||
table.insert(lua_rtp, 'lua/?.lua')
|
||||
table.insert(lua_rtp, 'lua/?/init.lua')
|
||||
require('lspconfig').sumneko_lua.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
runtime = {
|
||||
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||
version = 'LuaJIT',
|
||||
-- Setup your lua path
|
||||
path = lua_rtp,
|
||||
},
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = { 'vim', 'use' },
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file('', true),
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
require('lspconfig')['dockerls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
}
|
||||
|
||||
require('lspconfig')['yamlls'].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
yaml = {
|
||||
validate = false
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local null_ls = require('null-ls')
|
||||
null_ls.setup({
|
||||
sources = {
|
||||
null_ls.builtins.code_actions.gitsigns,
|
||||
null_ls.builtins.formatting.autopep8,
|
||||
null_ls.builtins.formatting.prettier,
|
||||
null_ls.builtins.diagnostics.flake8,
|
||||
null_ls.builtins.formatting.isort,
|
||||
null_ls.builtins.formatting.cmake_format,
|
||||
},
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
})
|
||||
|
||||
vim.diagnostic.config({ virtual_text = false })
|
@ -1,51 +0,0 @@
|
||||
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
|
||||
vim.fn.sign_define('DiagnosticSignError', { text = ' ', texthl = 'DiagnosticSignError' })
|
||||
vim.fn.sign_define('DiagnosticSignWarn', { text = ' ', texthl = 'DiagnosticSignWarn' })
|
||||
vim.fn.sign_define('DiagnosticSignInfo', { text = ' ', texthl = 'DiagnosticSignInfo' })
|
||||
vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' })
|
||||
|
||||
require('neo-tree').setup({
|
||||
window = { -- see https://github.com/MunifTanjim/nui.nvim/tree/main/lua/nui/popup for
|
||||
-- possible options. These can also be functions that return these options.
|
||||
position = 'float', -- left, right, float, current
|
||||
width = 40, -- applies to left and right positions
|
||||
popup = { -- settings that apply to float position only
|
||||
size = {
|
||||
height = '80%',
|
||||
width = '50%',
|
||||
},
|
||||
position = '50%', -- 50% means center it
|
||||
-- you can also specify border here, if you want a different setting from
|
||||
-- the global popup_border_style.
|
||||
},
|
||||
-- Mappings for tree window. See `:h nep-tree-mappings` for a list of built-in commands.
|
||||
-- You can also create your own commands by providing a function instead of a string.
|
||||
mappings = {
|
||||
['<space>'] = 'toggle_node',
|
||||
['<2-LeftMouse>'] = 'open',
|
||||
['<cr>'] = 'open',
|
||||
['s'] = 'open_split',
|
||||
['v'] = 'open_vsplit',
|
||||
['C'] = 'close_node',
|
||||
['z'] = 'close_all_nodes',
|
||||
['R'] = 'refresh',
|
||||
['a'] = 'add',
|
||||
['A'] = 'add_directory',
|
||||
['d'] = 'delete',
|
||||
['r'] = 'rename',
|
||||
['y'] = 'copy_to_clipboard',
|
||||
['x'] = 'cut_to_clipboard',
|
||||
['p'] = 'paste_from_clipboard',
|
||||
['c'] = 'copy', -- takes text input for destination
|
||||
['m'] = 'move', -- takes text input for destination
|
||||
['q'] = 'close_window',
|
||||
},
|
||||
},
|
||||
filesystem = {
|
||||
filtered_items = {
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '\\', '<cmd>Neotree reveal<cr>')
|
@ -1,20 +0,0 @@
|
||||
require('neogen').setup({
|
||||
enabled = true,
|
||||
languages = {
|
||||
cpp = {
|
||||
template = {
|
||||
annotation_convention = 'custom',
|
||||
custom = {
|
||||
{ nil, '/// file', { no_results = true, type = { 'file' } } },
|
||||
{ nil, '/// $1', { no_results = true, type = { 'func', 'file' } } },
|
||||
{ nil, '', { no_results = true, type = { 'file' } } },
|
||||
|
||||
{ nil, '/// $1', { type = { 'func' } } },
|
||||
{ 'tparam', '/// \\tparam %s $1' },
|
||||
{ 'parameters', '/// \\param %s $1' },
|
||||
{ 'return_statement', '/// \\return $1' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
@ -1 +0,0 @@
|
||||
require('nvim-autopairs').setup({})
|
@ -1,27 +0,0 @@
|
||||
require('nvim-tree').setup({
|
||||
auto_close = true,
|
||||
update_cwd = true,
|
||||
update_to_buf_dir = {
|
||||
-- enable the feature
|
||||
enable = true,
|
||||
-- allow to open the tree if it was previously closed
|
||||
auto_open = false,
|
||||
},
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_cwd = false,
|
||||
ignore_list = {},
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
icons = {
|
||||
hint = '',
|
||||
info = '',
|
||||
warning = '',
|
||||
error = '',
|
||||
},
|
||||
},
|
||||
})
|
||||
vim.keymap.set('n', '<leader>tt', '<cmd>NvimTreeToggle<CR>')
|
||||
vim.g.nvim_tree_highlight_opened_files = 1
|
||||
vim.g.nvim_tree_respect_buf_cwd = 1
|
@ -1 +0,0 @@
|
||||
require('octo').setup()
|
@ -1,5 +0,0 @@
|
||||
require('project_nvim').setup({
|
||||
silent_chdir = true,
|
||||
ignore_lsp = { 'null-ls', 'cmake' },
|
||||
})
|
||||
require('telescope').load_extension('projects')
|
@ -1,52 +0,0 @@
|
||||
local actions = require('telescope.actions')
|
||||
|
||||
local mappingTab = {
|
||||
i = {
|
||||
['<cr>'] = actions.select_tab,
|
||||
['<C-b>'] = actions.select_default,
|
||||
},
|
||||
}
|
||||
|
||||
require('telescope').setup({
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<esc>'] = actions.close,
|
||||
['<cr>'] = actions.select_default + actions.center,
|
||||
['<C-l>'] = actions.send_selected_to_loclist,
|
||||
['<C-q>'] = actions.smart_send_to_qflist,
|
||||
},
|
||||
},
|
||||
},
|
||||
pickers = {
|
||||
-- Your special builtin config goes in here
|
||||
buffers = {
|
||||
sort_lastused = true,
|
||||
theme = 'ivy',
|
||||
mappings = {
|
||||
i = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
['<cr>'] = actions.select_default,
|
||||
},
|
||||
n = {
|
||||
['<c-w>'] = actions.delete_buffer,
|
||||
},
|
||||
},
|
||||
},
|
||||
find_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
oldfiles = {
|
||||
theme = 'ivy',
|
||||
},
|
||||
git_files = {
|
||||
theme = 'ivy',
|
||||
previewer = false,
|
||||
},
|
||||
lsp_dynamic_workspace_symbols = {},
|
||||
},
|
||||
})
|
||||
|
||||
require('telescope').load_extension('fzf')
|
||||
require('telescope').load_extension('aerial')
|
@ -1,3 +0,0 @@
|
||||
require('nvim-terminal').setup({
|
||||
toggle_keymap = '<leader>z',
|
||||
})
|
@ -1,30 +0,0 @@
|
||||
require('toggleterm').setup({})
|
||||
|
||||
local Terminal = require('toggleterm.terminal').Terminal
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { noremap = true }
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<esc>', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', 'jk', [[<C-\><C-n>]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-h>', [[<C-\><C-n><C-W>h]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-j>', [[<C-\><C-n><C-W>j]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-k>', [[<C-\><C-n><C-W>k]], opts)
|
||||
vim.api.nvim_buf_set_keymap(0, 't', '<C-l>', [[<C-\><C-n><C-W>l]], opts)
|
||||
end
|
||||
|
||||
-- Disbled for the moment because it is also set for lazygit
|
||||
-- vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
local lazygit = Terminal:new({
|
||||
cmd = 'lazygit',
|
||||
-- dir = vim.fn.getcwd(),
|
||||
hidden = true,
|
||||
direction = 'float',
|
||||
on_open = function(term)
|
||||
vim.api.nvim_buf_set_keymap(term.bufnr, "n", "q", "<cmd>close<CR>", {noremap = true, silent = true})
|
||||
end,
|
||||
})
|
||||
|
||||
function _lazygit_toggle()
|
||||
lazygit:toggle()
|
||||
end
|
@ -1,48 +0,0 @@
|
||||
local parser = require('nvim-treesitter.parsers').filetype_to_parsername
|
||||
parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
||||
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = all,
|
||||
highlight = {
|
||||
enable = true
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true, -- Also highlight non-bracket delimiters like html tags, boolean or table: lang -> boolean
|
||||
max_file_lines = nil, -- Do not enable for files with more than n lines, int
|
||||
-- colors = {}, -- table of hex strings
|
||||
-- termcolors = {} -- table of colour name strings
|
||||
},
|
||||
indent = {
|
||||
enable = false -- maybe buggy
|
||||
},
|
||||
textobjects = {
|
||||
select = {
|
||||
enable = true,
|
||||
|
||||
-- Automatically jump forward to textobj, similar to targets.vim
|
||||
lookahead = true,
|
||||
|
||||
keymaps = {
|
||||
-- You can use the capture groups defined in textobjects.scm
|
||||
["af"] = "@function.outer",
|
||||
["if"] = "@function.inner",
|
||||
["ac"] = "@class.outer",
|
||||
["ic"] = "@class.inner",
|
||||
},
|
||||
},
|
||||
lsp_interop = {
|
||||
enable = true,
|
||||
border = 'none',
|
||||
peek_definition_code = {
|
||||
["<leader>df"] = "@function.outer",
|
||||
["<leader>dF"] = "@class.outer",
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("nvim-treesitter.install").prefer_git = true
|
||||
|
||||
-- local groovy_parser = require('nvim-treesitter.parsers').groovy
|
||||
-- groovy_parser.groovy = 'java' -- the someft filetype will use the python parser and queries.
|
@ -1,13 +0,0 @@
|
||||
require('yanky').setup()
|
||||
vim.api.nvim_set_keymap('n', 'p', '<Plug>(YankyPutAfter)', {})
|
||||
vim.api.nvim_set_keymap('n', 'P', '<Plug>(YankyPutBefore)', {})
|
||||
vim.api.nvim_set_keymap('x', 'p', '<Plug>(YankyPutAfter)', {})
|
||||
vim.api.nvim_set_keymap('x', 'P', '<Plug>(YankyPutBefore)', {})
|
||||
vim.api.nvim_set_keymap('n', 'gp', '<Plug>(YankyGPutAfter)', {})
|
||||
vim.api.nvim_set_keymap('n', 'gP', '<Plug>(YankyGPutBefore)', {})
|
||||
vim.api.nvim_set_keymap('x', 'gp', '<Plug>(YankyGPutAfter)', {})
|
||||
vim.api.nvim_set_keymap('x', 'gP', '<Plug>(YankyGPutBefore)', {})
|
||||
vim.keymap.set("n", "<c-n>", "<Plug>(YankyCycleForward)", {})
|
||||
vim.keymap.set("n", "<c-p>", "<Plug>(YankyCycleBackward)", {})
|
||||
|
||||
require("telescope").load_extension('yank_history')
|
122
lua/utils/python_venv.lua
Normal file
122
lua/utils/python_venv.lua
Normal file
@ -0,0 +1,122 @@
|
||||
local M = {}
|
||||
function M.getVenvSuffix()
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return 'bin/python'
|
||||
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
return 'Scripts/python.exe'
|
||||
end
|
||||
end
|
||||
|
||||
function M.getVenvFromJson(jsonfile)
|
||||
if not vim.fn.filereadable(jsonfile) then
|
||||
return nil
|
||||
end
|
||||
local f = io.open(jsonfile, 'r')
|
||||
if not f then
|
||||
return nil
|
||||
end
|
||||
local data = f:read('*a')
|
||||
f:close()
|
||||
if data then
|
||||
local jdata = vim.json.decode(data)
|
||||
if jdata['venvPath'] ~= nil and jdata['venv'] ~= nil then
|
||||
return jdata['venvPath'] .. '/' .. jdata['venv']
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
function M.getPythonEnv()
|
||||
local venv = os.getenv('VIRTUAL_ENV')
|
||||
if venv ~= nil then
|
||||
return string.format('%s/%s', venv, M.getVenvSuffix())
|
||||
end
|
||||
local conda = os.getenv('CONDA_PREFIX')
|
||||
if conda ~= nil then
|
||||
return string.format('%s/%s', conda, 'python.exe')
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
local jsonVenv = M.getVenvFromJson(cwd .. '/pyrightconfig.json')
|
||||
if jsonVenv ~= nil then
|
||||
return jsonVenv .. '/' .. M.getVenvSuffix()
|
||||
end
|
||||
|
||||
if vim.fn.executable(cwd .. '/venv/' .. M.getVenvSuffix()) == 1 then
|
||||
return cwd .. '/venv/' .. M.getVenvSuffix()
|
||||
elseif vim.fn.executable(cwd .. '/.venv/' .. M.getVenvSuffix()) == 1 then
|
||||
return cwd .. '/.venv/' .. M.getVenvSuffix()
|
||||
else
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
return '/usr/bin/python'
|
||||
elseif vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
return os.getenv('SCOOP') .. '/apps/python/current/python.exe'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function M.getPythonEnvs()
|
||||
local venvs = {}
|
||||
local venv = os.getenv('VIRTUAL_ENV')
|
||||
if venv ~= nil then
|
||||
table.insert(venvs, {
|
||||
name = 'VIRTUAL_ENV',
|
||||
path = string.format('%s/%s', venv, M.getVenvSuffix())
|
||||
})
|
||||
end
|
||||
local conda = os.getenv('CONDA_PREFIX')
|
||||
if conda ~= nil then
|
||||
table.insert(venvs, {
|
||||
name = 'CONDA_PREFIX',
|
||||
path = string.format('%s/%s', conda, 'python.exe')
|
||||
})
|
||||
end
|
||||
|
||||
local cwd = vim.fn.getcwd()
|
||||
|
||||
local jsonVenv = M.getVenvFromJson(cwd .. '/pyrightconfig.json')
|
||||
if jsonVenv ~= nil then
|
||||
table.insert(venvs, {
|
||||
name = 'pyrightconfig.json',
|
||||
path = jsonVenv .. '/' .. M.getVenvSuffix()
|
||||
})
|
||||
end
|
||||
|
||||
local venvDirs = { 'venv', '.venv' }
|
||||
for _, envDir in pairs(venvDirs) do
|
||||
if vim.fn.executable(cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()) == 1 then
|
||||
table.insert(venvs, {
|
||||
name = envDir,
|
||||
path = cwd .. '/' .. envDir .. '/' .. M.getVenvSuffix()
|
||||
})
|
||||
end
|
||||
end
|
||||
if vim.loop.os_uname().sysname == 'Linux' then
|
||||
table.insert(venvs, {
|
||||
name = 'system',
|
||||
path = '/usr/bin/python'
|
||||
})
|
||||
end
|
||||
if vim.loop.os_uname().sysname == 'Windows_NT' then
|
||||
table.insert(venvs, {
|
||||
name = 'system',
|
||||
path = os.getenv('SCOOP') .. '/apps/python/current/python.exe'
|
||||
})
|
||||
end
|
||||
return venvs
|
||||
end
|
||||
|
||||
M.pick_venv = function()
|
||||
vim.ui.select(M.getPythonEnvs(), {
|
||||
prompt = 'Select python venv',
|
||||
format_item = function(item) return string.format('%s (%s)', item.name, item.path) end,
|
||||
}, function(choice)
|
||||
if not choice then
|
||||
return
|
||||
end
|
||||
print(choice.path)
|
||||
end)
|
||||
end
|
||||
|
||||
return M
|
14
my_snippets/cpp.json
Normal file
14
my_snippets/cpp.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"TEST_F for g/setter": {
|
||||
"prefix": "TEST_F_getter",
|
||||
"body": [
|
||||
"TEST_F($1, test_${CLIPBOARD/m_(.*)/${1}/}_${2:setter}_${3:getter})",
|
||||
"{",
|
||||
" set${CLIPBOARD/m_(.)(.*)/${1:/upcase}${2}/}($4);",
|
||||
" ${5:type} result = get${CLIPBOARD/m_(.)(.*)/${1:/upcase}${2}/}();",
|
||||
" EXPECT_EQ($4, result);$0",
|
||||
"}"
|
||||
],
|
||||
"description": "Generate TEST_F body for getter and setter functions"
|
||||
}
|
||||
}
|
14
my_snippets/package.json
Normal file
14
my_snippets/package.json
Normal file
@ -0,0 +1,14 @@
|
||||
{
|
||||
"name": "my_snippets",
|
||||
"engines": {
|
||||
"vscode": "^1.11.0"
|
||||
},
|
||||
"contributes": {
|
||||
"snippets": [
|
||||
{
|
||||
"language": "cpp",
|
||||
"path": "./cpp.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
16
pyproject.toml
Normal file
16
pyproject.toml
Normal file
@ -0,0 +1,16 @@
|
||||
# pyproject.toml
|
||||
[tool.pytest.ini_options]
|
||||
minversion = "6.0"
|
||||
addopts = "-ra -q"
|
||||
testpaths = [
|
||||
"tests",
|
||||
]
|
||||
[tool.pyright]
|
||||
venv = "venv"
|
||||
venvPath = './'
|
||||
reportOptionalMemberAccess = 'warning'
|
||||
reportGeneralTypeIssues = 'warning'
|
||||
analyzeUnannotatedFunctions = 'false'
|
||||
executionEnvironments = [
|
||||
{ root = "./" }
|
||||
]
|
4
pyrightconfig.json
Normal file
4
pyrightconfig.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"venvPath": ".",
|
||||
"venv": "venvVis"
|
||||
}
|
Reference in New Issue
Block a user