433 Commits
lua ... monokai

Author SHA1 Message Date
80e3c762f5 added monokai 2023-05-24 21:13:25 +02:00
44376422e0 use backspace in oil 2023-05-23 16:33:04 +02:00
851238e0b9 beautify some telescope windows 2023-05-23 16:32:41 +02:00
a5b0466f17 update lock file 2023-05-23 15:48:39 +02:00
eb87655ced added oil 2023-05-23 15:48:17 +02:00
99008719e2 try nvim-rooter 2023-05-23 15:48:10 +02:00
f77d8674be always use the same icon repo 2023-05-23 15:47:55 +02:00
3dfbd9b8b6 optimize buffer sorting 2023-05-23 15:47:29 +02:00
62ffea7b57 don't use neo-tree when opening folders 2023-05-23 10:05:36 +02:00
148a870385 some borders 2023-05-21 09:41:01 +02:00
9207bbe62a use telescope go to definition\ 2023-05-20 18:24:49 +02:00
d1900be2af disbale autocommand for cursorline 2023-05-16 22:15:58 +02:00
c72644682d switched to new nerd font 3 2023-05-16 22:15:46 +02:00
4665a3b753 description for lazygit keys 2023-05-16 20:50:26 +02:00
5819910aee updated plugins 2023-05-13 10:38:34 +02:00
df73cb06c6 added surround plugin 2023-05-13 10:38:24 +02:00
fcd0795561 set lazy-lock to unix 2023-04-28 22:57:45 +02:00
6879b11ffa updated plugins 2023-04-27 22:48:46 +02:00
2ed815894f lsp_lines only on current line 2023-04-27 22:48:37 +02:00
476c83e7a8 fixed gruvbox colors 2023-04-27 22:45:57 +02:00
90494dfad6 added nvim_colorizer 2023-04-27 22:05:58 +02:00
6b020335df enable lsp_lines 2023-04-27 22:05:49 +02:00
5f17610dbf load lsp_lines with LspAttach 2023-04-27 22:05:18 +02:00
5542c5b564 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2023-04-27 19:08:06 +02:00
bbdfe3d6e8 added material colortheme 2023-04-27 19:07:42 +02:00
903112b0bb disable diagnostic float window 2023-04-26 20:34:34 +02:00
a11811019c added lsp_lines 2023-04-26 20:34:33 +02:00
8b373ff24f some small color updates 2023-04-17 15:19:41 +02:00
03e2166f57 put neovim in the title (for keepass) 2023-04-17 15:18:55 +02:00
8bd2e43052 use conaninfo.txt for root search 2023-04-11 08:21:19 +02:00
e725e4deee fixed diagnostics numbers in lualine 2023-04-07 14:03:39 +02:00
f5f903620f update plugins 2023-04-07 13:27:52 +02:00
7c8bf66b37 use more lazu opt fields 2023-04-07 13:27:44 +02:00
e8f5e62439 dont search root with neocmake 2023-04-05 12:10:39 +02:00
a94b098588 format lspconfig 2023-04-02 23:37:19 +02:00
4ee5f69566 added navbuddy 2023-04-02 23:37:08 +02:00
a0086b4380 cleaned up cmp.lua 2023-04-02 22:57:29 +02:00
0139368180 enabel scrollwheel scaling 2023-04-02 20:41:32 +02:00
63ff84fae1 scaling keymaps for neovide 2023-04-02 16:16:09 +02:00
1e15ac6637 don't use compile_commands.json for root search 2023-03-31 09:13:44 +02:00
170aa9c79f clangd: query for the cross compiler 2023-03-31 09:13:26 +02:00
56357acccf changed titlestring to cwd 2023-03-30 15:33:57 +02:00
506583b78a removed depracted lazy call 2023-03-24 17:31:18 +01:00
04c9200050 added cppdbg for linux dap adapter 2023-03-24 16:08:42 +01:00
9e8d143b24 no italic strings 2023-03-23 22:27:22 +01:00
849cb2a2c7 updated plugins 2023-03-23 22:26:17 +01:00
3324cb1fff fixed gruvbox config 2023-03-23 22:25:26 +01:00
ebefdb64ff trigger cmdline history with c-x 2023-03-19 22:51:35 +01:00
3e49aa40a5 fixed cmp CR behaviour at end of line 2023-03-19 21:55:02 +01:00
6e3a2f931c code format cmp.lua 2023-03-19 21:41:38 +01:00
4240bd1bde change cmp sorting again 2023-03-19 21:41:21 +01:00
8f6caa96e5 try to fix lauline theme 2023-03-19 21:29:04 +01:00
97c469b1ef set some lsp highlights 2023-03-19 15:43:26 +01:00
70a06005fe use gruvbox again 2023-03-19 15:19:19 +01:00
dcf6d687b8 fixed keymap for git log 2023-03-03 10:56:51 +01:00
eca6376d79 added advanced-git-search 2023-03-03 10:45:35 +01:00
33e497133c implement venv picker 2023-02-26 22:09:38 +01:00
bc278c2a62 added menufacture 2023-02-20 21:27:24 +01:00
99690477af use pythonvenv in neotest 2023-02-15 11:49:32 +01:00
5b4001d7e8 format dap.lua 2023-02-15 11:49:32 +01:00
02aa672af8 extract python venv utils 2023-02-15 11:49:32 +01:00
480b9c5db1 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2023-02-14 09:39:12 +01:00
91faa6b627 fixed lualine url 2023-02-13 22:18:13 +01:00
2670f4f656 updated plugins 2023-02-13 21:58:15 +01:00
7a2c6ecd29 fancy lualine config 2023-02-13 21:58:09 +01:00
656ff601a3 fixed lua lsp deprecated msg 2023-02-13 21:02:54 +01:00
2b592e82ad fixed path for venv 2023-01-31 20:45:10 +01:00
a15e7cba84 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2023-01-31 08:38:58 +01:00
d62c914ea5 added new cmake lsp 2023-01-31 08:38:52 +01:00
1792e54500 added octo 2023-01-30 21:43:40 +01:00
b9cf3aadef check for pyrightconfig.json in dap 2023-01-30 21:28:05 +01:00
b87bbaee74 format all lua files 2023-01-29 11:55:25 +01:00
fa0d4ffd8f telescope: ignore .git but search hidden files 2023-01-29 11:41:44 +01:00
c60cf314be removed ununsed 'use' keyword for lua 2023-01-29 11:41:28 +01:00
2b0d14d7a1 enable single quotes for lua code 2023-01-29 11:41:14 +01:00
7bdf105fac also show hidden files with file search 2023-01-29 11:28:31 +01:00
045a1af8dc removed some commented code 2023-01-29 11:18:24 +01:00
c911f288c6 udpated plugins 2023-01-29 11:16:00 +01:00
c81d9e0bda format lazygit 2023-01-29 11:15:50 +01:00
561b99ac1b configure debug for cmake tools 2023-01-29 00:38:47 +01:00
cfa7b243f3 fix code-lldb debugger 2023-01-28 23:47:27 +01:00
6c51bce00d added lazygit plugin 2023-01-28 21:39:46 +01:00
a7a4319243 beatiful lsp icons and messages 2023-01-27 23:31:22 +01:00
4565a3aabd format lua 2023-01-26 21:39:01 +01:00
413a11e741 don't clear the document highlight autogroup 2023-01-26 21:26:41 +01:00
b4e5f2b7b4 hopefully the final fix for document highlight 2023-01-26 20:41:44 +01:00
70d6dbda37 try to fix the highlight autocommand 2023-01-26 20:03:54 +01:00
100b358acb Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2023-01-26 13:42:45 +01:00
c5e740a70b commands for setting the font 2023-01-26 11:48:34 +01:00
7f00267ec8 use wsl clipboard manager from help 2023-01-24 17:53:34 +01:00
9e8672038e disbale unnamedplus because it is slow 2023-01-24 17:37:08 +01:00
4f5bd49e70 added gruvbox material 2023-01-24 17:36:50 +01:00
7d318b2512 refine the wsl clipboard 2023-01-24 13:00:38 +01:00
beba8b3c51 fixed clipboard for wsl 2023-01-24 12:42:50 +01:00
e2c55680ee added pyright in pyproject.toml 2023-01-13 18:29:49 +01:00
a5ceececb5 added document symbol mapping 2023-01-13 18:29:33 +01:00
ec07710b24 added diffview keymapping 2023-01-13 18:28:59 +01:00
b9c4ea5413 some tuning of lsp config 2023-01-12 14:27:17 +01:00
520858f6ac added example pyproject.toml 2023-01-10 20:53:27 +01:00
2b48e24a28 added cmd to cmake-toools 2023-01-10 20:53:15 +01:00
ee1033a856 updated plugin versions 2023-01-09 23:16:45 +01:00
1983373ba0 added leader p as telescope commands 2023-01-09 23:16:32 +01:00
f2f51655a0 fixed cmp config with autopairs 2023-01-09 23:16:18 +01:00
8de574df32 added cmake tools 2023-01-09 23:16:02 +01:00
ed78b61632 deleted old config 2023-01-09 22:31:35 +01:00
35552af831 added test snippet for cpp 2023-01-09 09:52:21 +01:00
874cb95f01 added example pyrightconfig.json 2023-01-09 09:51:53 +01:00
2d3f05b6be updated plugin versions 2023-01-09 09:24:44 +01:00
06b46caf29 added dressing 2023-01-09 09:24:31 +01:00
42fb43f54b Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2023-01-09 08:39:37 +01:00
b35136bae4 telescope find with file filters 2023-01-09 08:38:52 +01:00
5a1a8e8f3e added xmlformat 2023-01-05 22:23:31 +01:00
78cbde972f new keymap to run last dap config 2023-01-05 14:45:38 +01:00
e3c8a5ddd4 removed some debug code from neotest 2023-01-03 14:57:47 +01:00
c8e1906f22 added neotest 2023-01-03 14:30:34 +01:00
4aa3048e23 fixed annoying lua ls message 2023-01-03 01:50:51 +01:00
3a70a67737 added neodev 2023-01-03 01:48:51 +01:00
2c57a134e3 fixed some keybindings overwritten by which key 2023-01-03 01:48:40 +01:00
0c5f81d6d4 new sign for breakpoint 2023-01-02 21:46:27 +01:00
54e87b448e more keybinding description 2022-12-29 00:51:41 +01:00
1e7fd727c2 fixed warnings in lsp config 2022-12-28 21:45:23 +01:00
b6e811ab23 small neogen fix 2022-12-28 21:40:46 +01:00
98d3f5cac7 added which-key 2022-12-28 21:40:32 +01:00
b0918760d4 moved all plugins 2022-12-28 21:07:04 +01:00
9055e4e876 dap and leap 2022-12-28 20:44:18 +01:00
4916c4eca2 more restructering 2022-12-28 20:29:41 +01:00
ce61facff9 more restructure 2022-12-28 14:29:23 +01:00
fd16ef223a start restructering of lazy 2022-12-28 13:52:17 +01:00
5dd99d7085 remove esc to quit for telescope 2022-12-27 14:57:08 +01:00
9361934d8a use some very lazy things 2022-12-27 14:55:11 +01:00
4f0bab54b5 lazy load comment nvim 2022-12-27 14:33:46 +01:00
e562f3b996 added lazy lock file 2022-12-27 14:33:28 +01:00
17b3f53e11 add telescope ui select 2022-12-24 23:25:17 +01:00
c136b87b7b fixed overseer keybinding 2022-12-24 23:07:24 +01:00
1adb3c8ff2 don't autoinstall lsp server 2022-12-24 22:55:37 +01:00
b7167a3a47 format 2022-12-24 22:39:05 +01:00
62734cac5c keybinding for lazy and fixed legendary 2022-12-24 22:38:53 +01:00
fa41d32ae1 fixed lazygit keybinding 2022-12-24 22:36:47 +01:00
c52f6304d4 added project.nvim 2022-12-24 22:36:32 +01:00
e1e32cf52c use lazy 2022-12-24 15:05:56 +01:00
a62b9ca215 don't load the fzf extension in the telescope setup 2022-12-24 15:05:48 +01:00
6b9089ee85 fixed events and keys in lazy 2022-12-24 15:05:11 +01:00
8fb7e9ad0a added all plugins to lazy 2022-12-24 14:46:00 +01:00
738bcabefe start migrating to lazy plugin manager 2022-12-24 13:36:12 +01:00
dc534b5a38 fixed loading of aerial 2022-12-20 10:57:56 +01:00
51183ffd55 move project keymap to its config file 2022-12-11 13:05:34 +01:00
58ae25ee12 lazy load cmp 2022-12-10 19:29:28 +01:00
1d9f94e650 lazy load luasnip 2022-12-10 19:29:16 +01:00
5d7231efa2 lazy load lspconfig 2022-12-10 19:28:55 +01:00
1d436a3df7 lazy load yanky 2022-12-10 19:28:33 +01:00
b91b0b48b4 lazy load overseer and aerial 2022-12-09 13:18:58 +01:00
15f8c3ecf7 complete text from all visible buffers 2022-12-09 13:18:39 +01:00
d7705f1dec fixed dap lazy loading 2022-12-09 12:15:44 +01:00
74c87cee88 lazy load neogen 2022-12-09 12:05:44 +01:00
8fa2f0f0e1 format plugins file 2022-12-09 11:53:36 +01:00
49edb9e202 lazy load neotree 2022-12-09 11:53:15 +01:00
2d5f71805e removed commented line 2022-12-09 11:47:29 +01:00
45ea60d689 fixed lazy loading of dap 2022-12-09 11:47:16 +01:00
186052c31a remove command center 2022-12-07 08:32:36 +01:00
11b954ff33 extract some keys to the plugin configs 2022-12-05 15:12:09 +01:00
bce0373dfb move some keymaps to the corresponding plugin configs 2022-12-05 14:44:29 +01:00
e111deabc9 move to legendary 2022-12-05 14:13:55 +01:00
c5073fe73e refine telescope references view 2022-12-05 11:26:09 +01:00
62a276a336 remove luarc.json 2022-12-04 01:31:13 +01:00
a188cf2c9f removed hlargs 2022-12-03 17:38:48 +01:00
64f65a1d57 removed cmake plugin 2022-12-03 00:40:02 +01:00
814ebfa3ce renamed cmp.lua to my_cmp.lua 2022-12-02 17:01:43 +01:00
cdd13eeccc added overseer keybinding 2022-12-02 13:22:01 +01:00
f638d730ad removed unused plugins 2022-12-01 23:06:50 +01:00
c0dc96fd9d option for borders in pmenu 2022-12-01 21:18:20 +01:00
3546f84367 some colortheme fixes 2022-12-01 20:55:24 +01:00
8ef35063dd format 2022-12-01 17:03:19 +01:00
0fcdf98cf3 fixed popup icosn 2022-12-01 17:03:15 +01:00
78544dcdbf use clangd extensions 2022-12-01 16:55:18 +01:00
d8dee9c878 use capabilities from cmp 2022-12-01 16:55:05 +01:00
fa5c5f32a4 first try fixing sorting in cmp 2022-12-01 15:21:43 +01:00
4c3fce3ba2 added small link to cmake overseer example 2022-12-01 15:13:18 +01:00
8f26b25bef try components 2022-11-30 21:56:30 +01:00
e93e47bd69 only run when cmake available 2022-11-30 21:19:22 +01:00
2ff32c06fd added overseer 2022-11-30 21:09:02 +01:00
fb5373f0a7 added cmd line history cmp 2022-11-19 13:33:03 +01:00
0b17bf0cfb set search color with more contrast 2022-11-19 13:14:36 +01:00
11140c602e added shortcut for dap hover 2022-11-19 12:59:12 +01:00
c8f9050caf reworked dap keymaps 2022-11-19 11:09:56 +01:00
51eab5c6ea fixed deprecated message for aerial 2022-11-19 10:52:14 +01:00
9c86c2a32e removed some deprecated messages 2022-11-19 10:36:10 +01:00
9b8097dc36 disable lualine winbar for dap repl and console 2022-11-19 10:35:47 +01:00
15b03ee11f make sure we can exit dap terminal with esc 2022-11-17 15:00:43 +01:00
4b3bc84837 fixed esc for terminals 2022-11-17 14:15:49 +01:00
861b60e4f7 added missing gruvbox flat config file 2022-11-07 22:54:28 +01:00
ff7a190162 added gruvbox-flat 2022-11-04 19:12:44 +01:00
a2f360ddb4 fixed missing function getVenvSuffix 2022-11-04 19:00:38 +01:00
66477e10a0 also set cwd for launch.json configs 2022-11-03 20:32:16 +01:00
c8bbbe4057 fixed access to a local function 2022-11-03 20:32:02 +01:00
f7536e94ae set working dir 2022-11-03 20:27:14 +01:00
a09b75f16e support for launch.json 2022-11-03 20:27:06 +01:00
56797a2564 add support for conda 2022-11-03 20:26:29 +01:00
a64aeb9dd6 fixed python path if venv env variable is set 2022-11-03 11:59:44 +01:00
350d42333a deleted lspinstall file 2022-10-30 12:30:32 +01:00
45f61cf7fe removed database and tabnine completion 2022-10-30 12:30:31 +01:00
4b532e698f Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-10-30 12:23:39 +01:00
9fc33c2b44 fixed clangd encoding warning 2022-10-30 12:23:17 +01:00
474fe4cb44 disable shada read on focusgained 2022-10-30 12:22:43 +01:00
ea267d690f validate yaml 2022-10-30 12:18:43 +01:00
c23240ab03 dont lazy load aerial 2022-10-30 12:17:49 +01:00
8c672f19db setup cmp-dap correctly 2022-10-28 23:10:28 +02:00
476205ce47 cmp: do not select with return 2022-10-28 23:09:53 +02:00
837a273774 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-10-17 09:43:50 +02:00
3d0b66c7ab try to set the width for float popup 2022-10-17 09:43:44 +02:00
0dfcf42beb fixed deprecated in lsp confiog 2022-10-15 13:04:04 +02:00
8ea3ed7a79 disable git for neo-tree 2022-10-15 13:03:50 +02:00
518f32d3bb code format 2022-10-15 12:50:38 +02:00
db1ad041ab update nvim tree config 2022-10-06 17:54:59 +02:00
76249b2a8a Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-10-06 09:36:56 +02:00
e2460a2425 source selector for neo tree 2022-10-05 23:43:19 +02:00
5b6ae54763 fixed aerial config 2022-10-05 22:45:52 +02:00
3272e4067f lazy load diffview 2022-10-05 22:30:42 +02:00
1e8201cd13 lazy loading aerial 2022-10-05 22:26:37 +02:00
7629d6d57e fixed format mode 2022-10-05 19:36:26 +02:00
d0c31ea3b7 lazy loading of dap and cmake 2022-10-05 19:36:13 +02:00
570b9fe329 highlight word to silent 2022-10-05 12:02:21 +02:00
739b2154eb use more lua functions 2022-10-05 11:59:35 +02:00
edc73d3639 small fix for highlight word 2022-10-05 11:53:26 +02:00
d91ae17970 fixed highlight keymapping 2022-10-05 11:52:28 +02:00
f9d34430ae removed workarounds for old vim version 2022-10-02 21:27:44 +02:00
74e6cc3bb4 fixed color for text highlight 2022-09-28 13:45:33 +02:00
7e31d668ee fixed highlight groups for lsp highlight 2022-09-28 13:36:14 +02:00
4bbf17633d Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-09-28 09:12:05 +02:00
a7a5a41f8d more detection methods for project plugin 2022-09-28 09:11:34 +02:00
a3942972d8 fixed linux dap config 2022-09-26 09:07:15 +02:00
ea6e95aca8 disable litee 2022-09-20 20:40:05 +02:00
67067bde77 set lualine theme to gruvbox 2022-09-20 20:39:35 +02:00
d3e3bbc903 disable everything for vscode 2022-09-20 18:52:15 +02:00
dbfd744f97 also let project plugin detect build_nvim 2022-09-20 15:38:52 +02:00
b4d08255a5 enable old gruvbox again 2022-09-20 15:38:25 +02:00
827adacc68 clangd root dir detection with build_nvim 2022-09-20 15:38:02 +02:00
89b1d53451 use lualine for winbar 2022-09-19 10:51:56 +02:00
4ba64948eb formatted plugins file 2022-09-19 10:51:40 +02:00
48acab5f4b format lsp config file 2022-09-19 10:50:43 +02:00
0115553f37 make sure to set the leader in the beginning 2022-09-19 10:49:04 +02:00
a85b634110 fixed range formatting with ^>= 0.8 2022-09-16 10:18:07 +02:00
a24b928433 fixed comment shortcut 2022-09-16 10:00:37 +02:00
4c9b016540 added working.json 2022-09-15 09:31:35 +02:00
e32ff73562 fixed fzf build by using Ninja 2022-09-15 09:30:17 +02:00
774fdda969 added diffview 2022-09-15 09:25:58 +02:00
612ec0cbe6 some more fixes for different nvim versions 2022-09-10 13:39:45 +02:00
c19072c4cd winbar only with nvim ^>= 0.8 2022-09-09 20:51:20 +02:00
e72eaa724e added lldb-vscode adapter 2022-09-09 20:51:20 +02:00
e6d1091430 map build to f4 2022-09-09 20:51:20 +02:00
59d9b95eb9 add cpp config and fix adapter 2022-09-09 20:51:20 +02:00
ebd55ecc55 correctly call getpythonenv 2022-09-09 20:51:20 +02:00
41ce8f2063 use debugpy from mason 2022-09-09 20:51:20 +02:00
652a1c2aa7 fixed dap python config 2022-09-09 20:51:20 +02:00
988db59976 fixed clangd search dir 2022-09-09 08:35:10 +02:00
54e6d1b844 set capabilities correctly 2022-08-31 12:18:50 +02:00
bf80f95a9a Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-08-31 10:56:40 +02:00
99e1139337 cleanup python debug config 2022-08-09 14:47:36 +02:00
382871be03 auto launch debug ui 2022-08-09 14:47:20 +02:00
1ba7731c16 fixed visual selection in gruvbox baby 2022-08-09 14:47:05 +02:00
4a21802429 added python debug session with venv search 2022-08-09 14:17:01 +02:00
087e0faad2 added commands for font size 2022-08-08 10:00:45 +02:00
14fd19bde6 more dap plugins 2022-08-06 18:46:41 +02:00
8030c44a93 switch to gruvbox-baby 2022-08-06 18:40:48 +02:00
49f8494072 first running verion of dab python 2022-08-06 15:26:18 +02:00
69b5cace69 setup groovyls 2022-08-03 14:57:58 +02:00
5a22a03eba add clangd_extension as cmp dependency 2022-08-02 09:20:33 +02:00
c9c630ce61 format lua files 2022-07-31 14:18:55 +02:00
c792c0839b delete unused mason lua file 2022-07-31 14:16:20 +02:00
80cff42519 fixed lua language server loading with mason 2022-07-31 14:15:06 +02:00
d019626efb first version of dap 2022-07-31 13:57:57 +02:00
8953d89f3c Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-07-31 13:57:03 +02:00
860b97c24c fixd fzf build 2022-07-31 13:56:56 +02:00
deb6dea93b removed lazy loading 2022-07-31 13:56:40 +02:00
b396169fca replaced deprecated diagnostic calls 2022-07-31 13:16:40 +02:00
6a8c84250f set ttimeoutlen 2022-07-26 22:35:52 +02:00
894dba3337 use mason for lsp install 2022-07-26 22:17:09 +02:00
8ebf953ec7 added leap 2022-07-10 23:42:52 +02:00
3aea401281 added yanky keys and telescope 2022-07-09 00:43:34 +02:00
98a9f00bd6 delete tabout 2022-07-09 00:29:26 +02:00
03c102be95 format 2022-07-08 23:43:04 +02:00
3b3bc5b937 support for my own vscode snippets 2022-07-08 23:43:04 +02:00
5d4cf9bfdc setup the linux font 2022-07-07 22:21:57 +02:00
219a8c3e81 fixed autocommand for checktime 2022-07-07 21:59:04 +02:00
d7b2cc3156 added hlargs 2022-07-05 23:20:51 +02:00
f9888e9c2a update stable 2022-07-04 23:41:44 +02:00
8b79b38ca0 disable virtual text again 2022-07-04 23:40:56 +02:00
d6f71c8ab2 disbable get to location after file load 2022-07-01 21:14:12 +02:00
23a3a8f7c6 added additional command for comment 2022-07-01 21:13:57 +02:00
d525388f3f fixed highlight 2022-07-01 21:08:37 +02:00
4bd385dd55 disable indent for treesitter 2022-07-01 20:55:20 +02:00
f9d9bbd258 disable bold and italic 2022-07-01 20:55:03 +02:00
c607af6115 updated font 2022-07-01 20:25:37 +02:00
b12a673ba1 update colorscheme 2022-07-01 20:24:41 +02:00
3c9ecc9d53 added cmp signature help 2022-07-01 17:28:13 +02:00
be42757e5e fixed aerial keybinding 2022-07-01 17:27:43 +02:00
8020639f31 use x for visual mode instead of v 2022-07-01 16:44:37 +02:00
ec56132c85 no aerial status message 2022-07-01 15:26:30 +02:00
3392ebe270 use virtual text for diagnostics again 2022-07-01 15:26:14 +02:00
ad480c4d35 just use all treesitter modules 2022-07-01 13:56:35 +02:00
49bb25aec6 fixed statusline 2022-07-01 13:56:06 +02:00
c27b582b89 removed some unused keymaps 2022-07-01 13:55:21 +02:00
9e2890aed9 use vim.keymap.set 2022-07-01 13:47:16 +02:00
0a31d71c0c disable default mappings for comment 2022-06-30 13:57:03 +02:00
7b776c7e9f no lazyloading of treesitter 2022-06-27 09:19:51 +02:00
1f60a85098 removed jsonc treesitter 2022-06-27 09:18:50 +02:00
688493d39d disable virtual line blame 2022-06-26 15:13:02 +02:00
b099ba7efd rework status line 2022-06-26 14:38:26 +02:00
0c66846e4e setup aerial 2022-06-26 14:32:29 +02:00
d609883ff7 set lualine theme to gruvbox 2022-06-26 14:10:53 +02:00
5ad1c4be90 fixed deprecated format call 2022-06-26 14:00:43 +02:00
5f357b0db5 load blankline after treesitter 2022-06-26 13:53:32 +02:00
0a60ff63bd updated stable snapshot 2022-06-26 13:23:05 +02:00
a1bff62966 set winbar statusline 2022-06-26 13:22:46 +02:00
3a0e386252 fixed deprecated resolved_capabilities 2022-06-26 13:15:47 +02:00
37b7a68c45 comment out some cmp sources 2022-06-26 13:01:28 +02:00
607245c47d removed incline 2022-06-26 13:01:00 +02:00
2c277ee846 add cmp treesitter 2022-06-26 12:59:50 +02:00
37d7e60eef added litee calltree keys 2022-06-07 15:24:42 +02:00
2951e86e06 fixed f5 to build all 2022-06-07 15:24:23 +02:00
228171561f use find files if there is not git repo 2022-06-01 11:47:00 +02:00
b1754cf7db remove modes.nvim 2022-05-31 14:28:06 +02:00
1f8ef76f81 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-05-31 14:06:11 +02:00
9b4fcca0ce put comment to ctrl slash 2022-05-31 09:56:37 +02:00
d9f90a1f4b remove stylua because of the lsp serverr 2022-05-27 10:19:24 +02:00
5b4878f76d replace octo with litee gh 2022-05-27 10:19:03 +02:00
c6d9e5b891 add litee 2022-05-26 22:09:25 +02:00
b31bd343fa fixed code actions command 2022-05-25 11:13:26 +02:00
c6bdb676aa set yaml for clang config files 2022-05-25 11:12:36 +02:00
2bdc01b56f added clangd file 2022-05-23 15:37:11 +02:00
6eba3c6f3a added some octo keymaps 2022-05-13 15:00:21 +02:00
3b66cc0b3c fixed wrap 2022-05-13 13:41:05 +02:00
db6d89471c more commands 2022-05-13 13:40:55 +02:00
892ac617ee added incline 2022-05-13 13:40:46 +02:00
c54a515556 removed focus only from modes plugin 2022-05-11 23:35:15 +02:00
20cb51e2b5 removed tree sitter query lang 2022-05-11 17:47:15 +02:00
d6930cbb2f added octo 2022-05-11 17:46:54 +02:00
76a7aad423 set additional keymappings for us keyboard 2022-05-11 17:46:28 +02:00
c921ae0f4f format 2022-05-05 15:26:58 +02:00
8db95a1880 use something else for shada 2022-05-05 15:26:43 +02:00
4a6de72626 removed maintained from treesitter 2022-05-05 15:26:18 +02:00
6c8531b67a don't validate yaml files 2022-05-02 10:28:46 +02:00
e34744b677 set title and titlestring 2022-04-29 15:56:22 +02:00
8cafa90c01 added doskey file type in autocommands 2022-04-29 15:04:26 +02:00
2da1322e7f ignore cmake lsp for project plugin 2022-04-29 15:04:11 +02:00
c65f2c543b use command center for yanky 2022-04-20 22:54:51 +02:00
7bd0f10847 added yanky 2022-04-20 22:49:07 +02:00
2c4617f462 treesitter folding with space x :) 2022-04-20 22:18:18 +02:00
5dde3be206 reworked options 2022-04-20 21:54:55 +02:00
4fbe1c4174 use new autocommand functions 2022-04-20 21:35:50 +02:00
d7b49c4c4b use 0.7 keymappings 2022-04-20 15:14:11 +02:00
8a000f811c update to new command center format 2022-04-19 09:29:36 +02:00
7f99415c02 format my_plugins 2022-04-13 23:47:54 +02:00
257d2fffcf convert some keybindings to command center 2022-04-13 23:40:53 +02:00
3dc493ff7e command center added 2022-04-13 22:41:05 +02:00
651d1d0d2f don't lazyload luasnip 2022-04-07 20:44:35 +02:00
579cdff054 disable nvim-tree 2022-04-07 20:40:41 +02:00
96e1f3f6ed Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-04-05 08:28:28 +02:00
99e257dbc1 added toggleterm 2022-04-04 20:12:20 +02:00
f0f1c35740 Don't use null-ls in project nvimm 2022-04-04 20:12:20 +02:00
2425d5f29d more lua style 2022-04-04 20:12:20 +02:00
ab1de6c1de stylua 2022-04-04 20:12:20 +02:00
595a4d287b Configure lua lsp to have vim and use as global variables 2022-04-04 20:12:20 +02:00
641d2e0c9e Load cmp_luasnip after luasnip 2022-04-04 15:15:11 +02:00
1c10794866 Merge branch 'master' of https://git.freiewildbahn.de/oli/nvim 2022-04-04 14:49:13 +02:00
204f38c947 Don't show diagnostic windows if there is already a floating window 2022-04-04 14:46:22 +02:00
ee3b97648a Some lazy loading of plugins 2022-04-01 23:38:59 +02:00
4462d4af5c lazy load snippets 2022-04-01 23:15:33 +02:00
f307fb2124 Don't autoinstall groovyls 2022-04-01 23:15:25 +02:00
d23279a4a4 Fixed snippet loading 2022-03-31 20:31:59 +02:00
8220799933 Don't use neotree for buffers 2022-03-31 13:28:44 +02:00
752814db02 Added neotree 2022-03-29 13:02:25 +02:00
d57067ea70 get_setup is local 2022-03-28 23:42:05 +02:00
198141f63f removed whitespaces 2022-03-28 23:40:45 +02:00
018c25d0d7 Disable gruvbox material and setup config for gruvbox 2022-03-28 23:39:05 +02:00
04d69955d7 Fixed clangd extensions url 2022-03-28 22:58:20 +02:00
434611abf4 Move some keybinding to the plugin config file 2022-03-23 21:25:06 +01:00
f9d0bf5366 Removed unused variables in init 2022-03-23 21:18:39 +01:00
479c8686eb Move terminal to own config file 2022-03-23 21:18:03 +01:00
aa7bc38af6 Use default sorting in cmp 2022-03-17 00:11:28 +01:00
e3a6774b76 Added clangd_extensions 2022-03-16 23:55:26 +01:00
d219e43cc7 Fixed packer bootstrap 2022-03-16 23:04:13 +01:00
cb2b0e521f Added stable.json 2022-03-16 22:58:46 +01:00
c3deaa45c6 lua format 2022-03-16 22:56:51 +01:00
4c543d7f44 Added lua style file 2022-03-16 22:53:30 +01:00
8860d92ed1 Small fixes 2022-03-16 22:16:06 +01:00
a3d76bbd15 Finished all plugins 2022-03-16 21:37:13 +01:00
a1d6d33b34 move fzf native to telescope 2022-03-16 21:07:35 +01:00
fbdad999cd gitsigns, comment, cmake 2022-03-16 21:04:13 +01:00
cf9b76d0e0 nvim-tree and treesitter config to packer 2022-03-16 19:53:08 +01:00
c0aa5e03d0 More movement of setup files 2022-03-16 18:03:36 +01:00
86b8b65c99 Fixed autocommand for packer 2022-03-16 17:38:50 +01:00
61a052b960 Same for lsp and cmp 2022-03-16 17:38:38 +01:00
7e1182a11b First version of the packer plugin setup calls 2022-03-16 17:22:06 +01:00
d1b14f05c1 Floating window for packer 2022-02-28 21:20:18 +01:00
961ec74fbd Removed symbols outline 2022-02-28 20:47:25 +01:00
f8ff3b647f Added modes.nvim 2022-02-28 20:46:35 +01:00
79486cd892 set 'completeopt' to menu,menuone,noselect 2022-02-28 20:46:18 +01:00
da4f4674a5 Some lsp fixes 2022-02-28 14:31:25 +01:00
4a076eacd9 Set snapshot path of packer 2022-02-28 14:30:23 +01:00
7e40d7732f Disable the virtual text for warnings 2022-02-21 10:55:37 +01:00
b259a2ae23 Fixed the to regestry a keybinding 2022-02-21 10:55:14 +01:00
c643e834e0 Changed order of cmp sources, prefer snippets 2022-02-10 18:57:19 +01:00
ff41531888 Better leader a 2022-02-10 18:56:14 +01:00
3a700044c4 Fixed path to compile_commands.json 2022-02-10 18:56:04 +01:00
3209e01c99 More snippets 2022-02-10 18:55:49 +01:00
9bf991c537 First custom lua snippets 2022-02-10 10:55:13 +01:00
b8bca37446 No italic 2022-02-09 13:28:15 +01:00
86b5aeb691 Changed font and disabled bold 2022-02-04 09:58:23 +01:00
464644246c Only one treesitter config 2022-02-04 09:41:54 +01:00
6689c9b523 Changed git blame align to eol 2022-02-04 09:11:30 +01:00
4c5aa10996 Added dressing plugin (for cmake) 2022-02-04 09:11:10 +01:00
29b32edada changed to gruvbox 2022-02-04 09:10:56 +01:00
667e42fe57 Format 2022-02-04 09:10:33 +01:00
4dd3918382 added nvim-treesitter-textobjects 2022-02-04 09:10:20 +01:00
bec752c6b7 Small refactor 2022-02-01 15:42:50 +01:00
ab444ed7d9 Neogen fixes for doxygen 2022-02-01 15:42:30 +01:00
bd3af2a9a4 Disable cmake telescope integration 2022-02-01 13:12:25 +01:00
e72fa7324b For the moment disable previewer for files and git files 2022-02-01 13:12:11 +01:00
577a3cd1a7 Removed gitblame and neoclip 2022-02-01 13:11:53 +01:00
0d93bc8fa5 Update treesitter after packer update 2022-02-01 12:56:23 +01:00
9325519929 Dont use .gitignore for telescope files 2022-02-01 12:56:02 +01:00
71321b1d16 Enhance gruvbox theme 2022-01-31 10:58:13 +01:00
faeea7fb5f Fixed and added cmake-format 2022-01-31 10:58:13 +01:00
5c4e7a4000 Adjust lualine 2022-01-31 10:58:13 +01:00
cfff367b83 Keymapping for telescopy fuzzy find 2022-01-31 10:58:13 +01:00
25a5283cd6 Set format expr 2022-01-31 10:58:13 +01:00
3f9a7f38fb Added neogen 2022-01-29 23:45:16 +01:00
0e13e43fc3 Disable space key in normal mode 2021-12-21 22:22:08 +01:00
0e92584aaf Only set lsp keymaps if server attached 2021-12-21 22:21:54 +01:00
b7020671d7 Removed double mappings 2021-12-21 22:21:41 +01:00
31ca3a6d00 Auto install lsp servers 2021-12-21 22:07:59 +01:00
8fabdb2d07 Merge branch 'lua'
# Conflicts:
#	init.vim
2021-12-21 21:52:54 +01:00
6db33686b5 Adopt for vscode neovim plugin 2021-06-12 20:07:54 +02:00
69 changed files with 2684 additions and 631 deletions

71
.clangd Normal file
View File

@ -0,0 +1,71 @@
Diagnostics:
UnusedIncludes: Strict
ClangTidy:
Add:
- cppcoreguidelines-*
- clang-analyzer-core.*
- bugprone-assert-side-effect
- bugprone-branch-clone
- bugprone-copy-constructor-init
- bugprone-exception-escape
- bugprone-forward-declaration-namespace
- bugprone-incorrect-roundings
- bugprone-infinite-loop
- bugprone-integer-division
- bugprone-macro-parentheses
- bugprone-multiple-statement-macro
- bugprone-parent-virtual-call
- bugprone-redundant-branch-condition
- bugprone-reserved-identifier
- bugprone-sizeof-container
- bugprone-sizeof-expression
- bugprone-string-constructor
- bugprone-string-integer-assignment
- bugprone-suspicious-enum-usage
- bugprone-suspicious-include
- bugprone-suspicious-missing-comma
- bugprone-suspicious-semicolon
- bugprone-swapped-arguments
- bugprone-terminating-continue
- bugprone-too-small-loop-variable
- llvm-namespace-comment
- misc-definitions-in-headers
- misc-redundant-expression
- misc-unused-parameters
- hicpp-signed-bitwise
- readability-identifier-naming
- readability-duplicate-include
- readability-braces-around-statements
- readability-implicit-bool-conversion
- readability-inconsistent-declaration-parameter-name
- readability-make-member-function-const
- readability-misleading-indentation
- readability-redundant-declaration
- readability-redundant-preprocessor
- readability-redundant-member-init
- readability-simplify-boolean-expr
- readability-static-accessed-through-instance
- readability-uppercase-literal-suffix
Remove:
- readability-avoid-const-params-in-decls
- readability-function-cognitive-complexity
- readability-magic-numbers
- readability-identifier-length
- cppcoreguidelines-explicit-virtual-functions
- cppcoreguidelines-init-variables
- cppcoreguidelines-non-private-member-variables-in-classes
- cppcoreguidelines-avoid-magic-numbers
- cppcoreguidelines-owning-memory
- cppcoreguidelines-pro-bounds-constant-array-index
- cppcoreguidelines-special-member-functions
- cppcoreguidelines-avoid-c-arrays
- cppcoreguidelines-pro-type-reinterpret-cast
CheckOptions:
readability-identifier-naming.FunctionCase: camelBack
readability-identifier-naming.NamespaceCase: lower_case
readability-identifier-naming.ClassCase: CamelCase
readability-identifier-naming.PrivateMemberPrefix: m_
readability-identifier-naming.StructCase: CamelCase
readability-identifier-naming.VariableCase: camelBack
readability-identifier-naming.GlobalConstantCase: UPPER_CASE
readability-identifier-naming.EnumConstant: UPPER_CASE

3
.gitignore vendored
View File

@ -5,3 +5,6 @@ vim.bundle
plugged plugged
rplugin.vim rplugin.vim
plugin/packer_compiled.lua plugin/packer_compiled.lua
venv_debugpy
.luarc.json
.luarc.json

View File

@ -1,5 +0,0 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"Lua.diagnostics.disable": ["undefined-global"]
}

140
init.lua
View File

@ -1,135 +1,7 @@
local cmd = vim.cmd -- to execute Vim commands e.g. cmd('pwd') vim.g.mapleader = ','
local fn = vim.fn -- to call Vim functions e.g. fn.bufnr() if not vim.g.vscode then
local g = vim.g -- a table to access global variables require('config.lazy')
local opt = vim.opt -- to set options require('my_keymappings')
local utils = require('utils') require('my_autocommands')
require('config.options')
-------------------- PACKER --------------------------------
-- Auto install packer.nvim if not exists
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
vim.cmd 'packadd packer.nvim'
end end
vim.cmd [[packadd packer.nvim]]
-------------------- EXTERNAL ------------------------------
require('my_plugins')
require('my_keymappings')
require('my_options')
require("my_autocommands")
-- plugins
require('my_telescope')
require('my_lspinstall')
require('my_cmp')
-------------------- TREE-SITTER ---------------------------
require('nvim-treesitter.configs').setup({
ensure_installed = 'maintained',
highlight = {
enable = true
}
})
-------------------- GITSIGNS ------------------------------
require('gitsigns').setup()
-------------------- NVIM-TREE -----------------------------
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 = "",
}
},
})
utils.map('n', '<leader>tt', '<cmd>NvimTreeToggle<CR>')
g.nvim_tree_highlight_opened_files = 1
g.nvim_tree_respect_buf_cwd = 1
-------------------- COMMENTED -----------------------------
require('Comment').setup({
toggler = {
---line-comment toggle
line = '<leader>cc',
},
opleader = {
---line-comment opfunc mapping
line = '<leader>c',
},
})
-------------------- CMAKE ---------------------------------
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.
})
utils.map('n', '<F5>', ':CMake build<CR>:copen<CR>')
-- msbuild errorformat
opt.errorformat:append("\\ %#%f(%l\\\\\\,%c):\\ %m")
-- cl.exe errorformat
-- o.errorformat:append('\ %#%f(%l) : %#%t%[A-z]%# %m')
-------------------- NEOCLIP -------------------------------
require('neoclip').setup({
default_register = '+',
})
require('telescope').load_extension('neoclip')
-------------------- LUALINE -------------------------------
require('lualine').setup {
options = {theme = 'gruvbox'},
sections = {lualine_c = {'getcwd', 'filename', 'nvim_treesitter#statusline'},
}
}
-------------------- PROJECT -------------------------------
require("project_nvim").setup {
silent_chdir = true,
}
require('telescope').load_extension('projects')
utils.map('n', '<space>p', '<cmd>Telescope projects<cr>')
-------------------- TS-RAINBOW ----------------------------
require'nvim-treesitter.configs'.setup {
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
}
}
-------------------- LUASNIP -------------------------------
require("luasnip.loaders.from_vscode").load()
-------------------- AUTOPAIRS -----------------------------
require('nvim-autopairs').setup{}
-------------------- FZF NATIVE ----------------------------
require('telescope').load_extension('fzf')
-------------------- TERMINAL ------------------------------
require('nvim-terminal').setup({
toggle_keymap = '<leader>z',
})
-------------------- INDENT-BLANKLINE ----------------------
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'},
}

73
lazy-lock.json Normal file
View 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
View 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', {})

80
lua/config/options.lua Normal file
View File

@ -0,0 +1,80 @@
vim.cmd('filetype plugin indent on')
vim.cmd('language en_US.utf-8')
local opt = vim.opt
local indent = 2
opt.termguicolors = true -- Enable colors in terminal
opt.hlsearch = true --Set highlight on search
opt.number = true --Make line numbers default
opt.relativenumber = false --Make relative number default
opt.mouse = 'a' --Enable mouse mode
opt.breakindent = true --Enable break indent
opt.undofile = true --Save undo history
opt.ignorecase = true --Case insensitive searching unless /C or capital in search
opt.smartcase = true -- Smart case
opt.updatetime = 300 --Decrease update time
opt.signcolumn = 'yes' -- Always show sign column
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.
opt.scrolloff = 999 -- Lines of context
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.shiftwidth = indent
opt.tabstop = indent
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 = '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.title = true
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
-- opt.whichwrap:append('<>[]hl')
-- disable nvim intro
opt.shortmess:append('sI')
-- Treesitter based folding
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'

View File

@ -1,45 +1,79 @@
function nvim_create_augroups(definitions) local api = vim.api
for group_name, definition in pairs(definitions) do
vim.cmd('augroup ' .. group_name)
vim.cmd('autocmd!')
for _, def in ipairs(definition) do
local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ')
vim.cmd(command)
end
vim.cmd('augroup END')
end
end
local autocmds = { -- Highlight on yank
packer = { local yankGrp = api.nvim_create_augroup('YankHighlight', { clear = true })
{ 'BufWritePost', 'plugins.lua', 'PackerCompile' }; api.nvim_create_autocmd('TextYankPost', {
}; command = 'silent! lua vim.highlight.on_yank()',
restore_cursor = { group = yankGrp,
{ 'BufRead', '*', [[call setpos(".", getpos("'\""))]] }; })
};
save_shada = {
{'FocusGained,FocusLost', '*', 'rshada|wshada'};
};
resize_windows_proportionally = {
{ 'VimResized', '*', ':wincmd =' };
};
lua_highlight = {
{ 'TextYankPost', '*', [[silent! lua vim.highlight.on_yank() {higroup='IncSearch', timeout=400}]] };
};
file_type = {
{'BufRead,BufNewFile', '*.simvis', 'set filetype=xml'};
{'BufRead,BufNewFile', '*.simcfg,*.simcon,*.simudex', 'set filetype=cfg'};
{'BufRead,BufNewFile', 'Jenkinsfile*', 'set filetype=groovy'};
{'BufRead,BufNewFile', '*.manifest', 'set filetype=xml'};
{'BufRead,BufNewFile', 'SConstruct,SConscript', 'set filetype=python'};
};
file_changed = {
{'BufEnter,FocusGained', '*', 'checktime'};
};
no_auto_comment = {
{'BufEnter', '*', 'set fo-=c fo-=r fo-=o'}
}
}
nvim_create_augroups(autocmds) -- Filetypes
local fileGrp = api.nvim_create_augroup('file_type', { clear = true })
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { '*.simvis', '*.manifest' },
callback = function()
vim.bo.filetype = 'xml'
end,
group = fileGrp,
})
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { '*.simcfg', '*.simcon', '*.simudex' },
callback = function()
vim.bo.filetype = 'xml'
end,
group = fileGrp,
})
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { 'JenkinsFile*' },
callback = function()
vim.bo.filetype = 'groovy'
end,
group = fileGrp,
})
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { 'SConstruct', 'SConscript' },
callback = function()
vim.bo.filetype = 'python'
end,
group = fileGrp,
})
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { 'doskey' },
callback = function()
vim.bo.filetype = 'dosini'
end,
group = fileGrp,
})
api.nvim_create_autocmd({ 'BufRead', 'BufNewFile' }, {
pattern = { '.clangd', '.clang-tidy' },
callback = function()
vim.bo.filetype = 'yaml'
end,
group = fileGrp,
})
-- Read and write shada file
api.nvim_create_autocmd({ 'FocusLost' }, { command = [[wshada]] })
-- go to last loc when opening a buffer
-- api.nvim_create_autocmd(
-- 'BufReadPost',
-- { command = [[if line("'\"") > 1 && line("'\"") <= line("$") | execute "normal! g`\"" | endif]] }
-- )
-- Check if we need to reload the file when it changed
api.nvim_create_autocmd({ 'FocusGained', 'BufEnter' },
{ command = [[if !bufexists("[Command Line]") | checktime | endif]] })
-- windows to close with "q"
api.nvim_create_autocmd(
'FileType',
{ pattern = { 'help', 'startuptime', 'qf', 'lspinfo' }, command = [[nnoremap <buffer><silent> q :close<CR>]] }
)
api.nvim_create_autocmd('FileType', { pattern = 'man', command = [[nnoremap <buffer><silent> q :quit<CR>]] })
-- 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 =]] })

View File

@ -1,118 +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 = 'nvim_lsp'}, {name = 'buffer'}, {name = "luasnip"},
{name = "nvim_lua"}, {name = "look"}, {name = "path"},
{name = 'cmp_tabnine'}, {name = "calc"}, {name = "spell"},
{name = "emoji"}
},
completion = {completeopt = 'menu,menuone,noinsert, noselect'},
-- 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)

View File

@ -1,90 +1,61 @@
local utils = require('utils') local opts = { noremap = true, silent = true }
vim.g.mapleader = ','
-- Paste from clipboard
utils.map('n', '<leader>p', '"+p')
utils.map('n', '<leader>P', '"+P')
utils.map('v', '<leader>p', '"+p')
utils.map('v', '<leader>P', '"+P')
-- Yank to clipboard
utils.map('v', '<leader>y', '"+y')
utils.map('n', '<leader>Y', '"+yg_')
utils.map('n', '<leader>y', '"+y')
utils.map('n', '<leader>yy', '"+yy')
-- Tabs -- Tabs
utils.map('n', '<F2>', ':tabnew .<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<S-Right>', ':tabnext<CR>', opts)
utils.map('i', '<F2>', '<Esc>:tabnew .<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<S-Left>', ':tabprevious<CR>', opts)
-- utils.map('n', '<S-Right>', ':BufferLineCycleNext<CR>')
-- utils.map('n', '<S-Left>', ':BufferLineCyclePrev<CR>')
utils.map('n', '<S-Right>', ':tabnext<CR>', { noremap = true, silent = true })
utils.map('n', '<S-Left>', ':tabprevious<CR>', { noremap = true, silent = true })
-- Split movement -- Split movement
utils.map('n', '<A-Up>', ':wincmd k<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<A-Up>', ':wincmd k<CR>', opts)
utils.map('n', '<A-Down>', ':wincmd j<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<A-Down>', ':wincmd j<CR>', opts)
utils.map('n', '<A-Left>', ':wincmd h<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<A-Left>', ':wincmd h<CR>', opts)
utils.map('n', '<A-Right>', ':wincmd l<CR>', { noremap = true, silent = true }) vim.keymap.set('n', '<A-Right>', ':wincmd l<CR>', opts)
-- Open a new vertical split window with Ctrl - F2
utils.map('n', '<C-F2>', ':vsplit .<CR>', { noremap = true, silent = true })
utils.map('i', '<C-F2>', '<Esc>:vsplit .<CR>', { noremap = true, silent = true })
-- Open a new horizontal split window with Shift - F2
utils.map('n', '<S-F2>', ':split .<CR>', { noremap = true, silent = true })
utils.map('i', '<S-F2>', '<Esc>:split .<CR>', { noremap = true, silent = true })
utils.map('n', '<C-S>', ':wa<CR>') vim.keymap.set('n', '<C-S>', ':wa | wshada<CR>')
-- Linewrap and jumping -- Linewrap and jumping
utils.map('n', 'k', 'gk') vim.keymap.set({ 'n', 'x' }, 'k', 'gk', opts)
utils.map('n', 'j', 'gj') vim.keymap.set({ 'n', 'x' }, 'j', 'gj', opts)
utils.map('n', '0', 'g0') vim.keymap.set({ 'n', 'x' }, '0', 'g0', opts)
utils.map('n', '$', 'g$') vim.keymap.set({ 'n', 'x' }, '$', 'g$', opts)
utils.map('n', '<Up>', 'gk') vim.keymap.set({ 'n', 'x' }, '<Up>', 'gk', opts)
utils.map('n', '<Down>', 'gj') vim.keymap.set({ 'n', 'x' }, '<Down>', 'gj', opts)
utils.map('n', '<Home>', 'g<Home>') vim.keymap.set({ 'n', 'x' }, '<Home>', 'g<Home>', opts)
utils.map('n', '<End>', 'g<End>') vim.keymap.set({ 'n', 'x' }, '<End>', 'g<End>', opts)
utils.map('v', 'k', 'gk')
utils.map('v', 'j', 'gj')
utils.map('v', '0', 'g0')
utils.map('v', '$', 'g$')
utils.map('v', '<Up>', 'gk')
utils.map('v', '<Down>', 'gj')
utils.map('v', '<Home>', 'g<Home>')
utils.map('v', '<End>', 'g<End>')
utils.map('v', '<', '<gv') vim.keymap.set('x', '<', '<gv')
utils.map('v', '>', '>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 -- Highlight word under cursor
utils.map('n', 'ü', ":let @/='\\<<C-R>=expand(\"<cword>\")<CR>\\>'<CR>:set hls<CR>", { noremap = true, silent = true }) vim.keymap.set('n', "'", hlWord, { noremap = true, silent = true, desc = 'Higlight word under cursor' })
utils.map('v', 'ü', "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>") utils.map('v', 'ü', "y:let @/='<C-R>=escape(@\",'/\\')<CR>'<CR>:set hls<CR>", { noremap = true, silent = true }) vim.keymap.set('x', "'", 'y/\\V<C-R>"<CR>N', { noremap = true, silent = true, desc = 'Highlight visual' })
-- Close Buffer -- Close Buffer
utils.map('n', '<C-w>', ':bd<CR>') vim.keymap.set('n', '<C-w>', ':bd<CR>', { desc = 'Close buffer' })
-- <Tab> to navigate the completion menu vim.keymap.set('n', '<space>x', 'za', { desc = 'Toggle fold' })
utils.map('i', '<S-Tab>', 'pumvisible() ? "\\<C-p>" : "\\<Tab>"', {expr = true})
utils.map('i', '<Tab>', 'pumvisible() ? "\\<C-n>" : "\\<Tab>"', {expr = true})
-- Telescope
utils.map('n', '<leader>f', '<cmd>Telescope find_files<cr>')
utils.map('n', '<C-p>', '<cmd>Telescope find_files<cr>')
utils.map('n', '<leader>g', '<cmd>Telescope git_files<cr>')
utils.map('n', '<leader>o', '<cmd>Telescope oldfiles<cr>')
utils.map('n', '<leader>h', '<cmd>Telescope command_history<cr>')
utils.map('v', '<leader>h', '<cmd>Telescope command_history<cr>')
utils.map('n', '<C-S-p>', '<cmd>Telescope commands<cr>')
utils.map('n', '<leader>b', '<cmd>Telescope buffers<cr>')
utils.map('n', '<leader>q', '<cmd>Telescope quickfix<cr>')
utils.map('n', '<leader>l', '<cmd>Telescope live_grep<cr>')
utils.map('n', '<space>r', '<cmd>Telescope lsp_references<cr>')
utils.map('n', '<C-S-o>', '<cmd>Telescope lsp_document_symbols<cr>')
utils.map('n', '<A-m>', '<cmd>Telescope lsp_document_symbols<cr>')
utils.map('n', '<space>v', '<cmd>Telescope diagnostics bufnr=0<cr>')
utils.map('n', '<C-y>', '<cmd>Telescope neoclip<cr>')
utils.map('n', '<leader>j', '<cmd>Telescope jumplist<cr>')
-- wildmode 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' })
-- Symbols Outline vim.api.nvim_create_user_command('WinFont', 'set guifont=JetBrainsMonoNL\\ NF:h9', {})
utils.map('n', '<leader>s', '<cmd>SymbolsOutline<cr>') 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

View File

@ -1,108 +0,0 @@
local utils = require('utils')
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.textDocument.completion.completionItem.resolveSupport = {
properties = {
'documentation',
'detail',
'additionalTextEdits',
},
}
local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
local opts = { noremap=true, silent=true }
utils.map('n', '<space>,', '<cmd>lua vim.lsp.diagnostic.goto_prev()<CR>', opts)
utils.map('n', '<space>;', '<cmd>lua vim.lsp.diagnostic.goto_next()<CR>', opts)
utils.map('n', '<space>a', '<cmd>Telescope lsp_code_actions<CR>', opts)
utils.map('n', '<space>d', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
utils.map('n', '<space>e', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
utils.map('n', '<space>h', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
utils.map('n', '<space>c', '<cmd>lua vim.lsp.buf.outgoing_calls()<CR>', opts)
utils.map('n', '<space>C', '<cmd>lua vim.lsp.buf.incoming_calls()<CR>', opts)
utils.map('n', '<space>m', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
-- utils.map('n', '<space>r', '<cmd>lua vim.lsp.buf.references()<CR, opts>')
utils.map('n', '<space>s', '<cmd>lua vim.lsp.buf.document_symbol()<CR>', opts)
utils.map('n', '<C-t>', '<cmd>Telescope lsp_dynamic_workspace_symbols<CR>', opts)
utils.map('n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
utils.map('n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
utils.map('n', '<space>r', '<cmd>Telescope lsp_references<cr>')
utils.map('n', '<C-S-o>', '<cmd>Telescope lsp_document_symbols<cr>')
utils.map('n', '<A-m>', '<cmd>Telescope lsp_document_symbols<cr>')
utils.map('n', '<space>v', '<cmd>Telescope diagnostics bufnr=0<cr>')
utils.map('n', '<A-o>', ':ClangdSwitchSourceHeader<CR>', opts)
-- Set some keybinds conditional on server capabilities
if client.resolved_capabilities.document_formatting then
utils.map('n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
end
if client.resolved_capabilities.document_range_formatting then
utils.map('v', '<space>f', '<esc><cmd>lua vim.lsp.buf.range_formatting()<CR>', opts)
end
-- Set autocommands conditional on server_capabilities
if client.resolved_capabilities.document_highlight then
vim.api.nvim_exec([[
hi LspReferenceRead cterm=bold ctermbg=red guibg=DarkGreen
hi LspReferenceText cterm=bold ctermbg=Black guibg=DarkYellow guifg=Black
hi LspReferenceWrite cterm=bold ctermbg=red guibg=DarkRed
augroup lsp_document_highlight
autocmd! * <buffer>
autocmd CursorHold <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorHoldI <buffer> lua vim.lsp.buf.document_highlight()
autocmd CursorMoved <buffer> lua vim.lsp.buf.clear_references()
augroup END
]], false)
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
local lsp_installer = require("nvim-lsp-installer")
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 == "tsserver" then
-- opts.root_dir = function() ... end
-- 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.formatting.stylua,
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.formatting.isort
},
on_attach = on_attach,
capabilities = capabilities
}

View File

@ -1,35 +0,0 @@
local utils = require('utils')
vim.cmd 'colorscheme gruvbox-material' -- Put your favorite colorscheme here
vim.cmd 'syntax enable'
vim.cmd 'filetype plugin indent on'
vim.cmd 'language en_US.utf-8'
utils.opt('o', 'hlsearch', true)
utils.opt('o', 'guifont', 'Hack NF:h9')
utils.opt('o', 'swapfile', false)
utils.opt('o', 'backup', false)
utils.opt('o', 'spelllang', 'en,de')
local indent = 2
utils.opt('b', 'expandtab', true)
utils.opt('b', 'shiftwidth', indent)
utils.opt('b', 'smartindent', true)
utils.opt('b', 'tabstop', indent)
utils.opt('o', 'hidden', true)
utils.opt('o', 'ignorecase', true)
utils.opt('o', 'scrolloff', 4 )
utils.opt('o', 'shiftround', true)
utils.opt('o', 'relativenumber', false)
utils.opt('o', 'smartcase', true)
utils.opt('o', 'splitbelow', true)
utils.opt('o', 'splitright', true)
utils.opt('o', 'wildmode', 'longest:full,full')
utils.opt('w', 'number', true)
utils.opt('o', 'clipboard', 'unnamed,unnamedplus')
utils.opt('o', 'mouse', 'a')
utils.opt('o', 'wrap', false)
utils.opt('o', 'termguicolors', true)
utils.opt('o', 'splitbelow', true)
utils.opt('o', 'splitright', true)
utils.opt('o', 'list', true)
utils.opt('o', 'updatetime', 300)
utils.opt('o', 'wrap', true)
utils.opt('o', 'showmatch', true)

View File

@ -1,55 +0,0 @@
return require('packer').startup(function()
-- Packer can manage itself as an optional plugin
use {'wbthomason/packer.nvim'}
use {'neovim/nvim-lspconfig'}
use {'nvim-treesitter/nvim-treesitter'}
use {
'nvim-telescope/telescope.nvim',
requires = {{'nvim-lua/popup.nvim'}, {'nvim-lua/plenary.nvim'}, {'kyazdani42/nvim-web-devicons'}}
}
use {'sainnhe/gruvbox-material'}
use {'lukas-reineke/indent-blankline.nvim'}
use {'nvim-lua/plenary.nvim'}
use {'lewis6991/gitsigns.nvim'}
use {
'kyazdani42/nvim-tree.lua',
requires = 'kyazdani42/nvim-web-devicons'
}
use{'numToStr/Comment.nvim'}
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'
}
}
use {'rafamadriz/friendly-snippets'}
use {'onsails/lspkind-nvim'}
use {'Shatur/neovim-cmake',
requires = {'mfussenegger/nvim-dap'}
}
use {'AckslD/nvim-neoclip.lua'}
use {
'hoob3rt/lualine.nvim',
requires = {'kyazdani42/nvim-web-devicons', opt = true}
}
use {'ahmedkhalf/project.nvim'}
use {'p00f/nvim-ts-rainbow'}
use {'simrat39/symbols-outline.nvim'}
use {'f-person/git-blame.nvim'}
use {'windwp/nvim-autopairs'}
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make'}
use {'ray-x/lsp_signature.nvim'}
use {'s1n7ax/nvim-terminal'}
use {
'williamboman/nvim-lsp-installer',
requires = {'neovim/nvim-lspconfig'}
}
use {
'jose-elias-alvarez/null-ls.nvim',
requires = {'nvim-lua/plenary.nvim'}
}
end)

View File

@ -1,48 +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',
},
oldfiles = {
theme = 'ivy',
},
git_files = {
theme = 'ivy',
},
lsp_dynamic_workspace_symbols = {
},
}
}

View 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,
},
}

View 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,
},
}

View 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

View 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,
},
}

View 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
View 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',
}
}
}

View 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
View 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
View 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
View 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
View 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
View File

@ -0,0 +1,3 @@
return {
'stevearc/dressing.nvim'
}

12
lua/plugins/gitsigns.lua Normal file
View 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
View 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
}

View 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
}

View 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
}

View 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
View File

@ -0,0 +1,2 @@
return {
}

25
lua/plugins/lazygit.lua Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
}

View 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
View 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
View 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
View 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
View 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
View 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
}
}
}

View File

@ -0,0 +1,10 @@
return {
'NvChad/nvim-colorizer.lua',
config = true,
cmd = {
'ColorizerAttachToBuffer',
'ColorizerDetachFromBuffer',
'ColorizerReloadAllBuffers',
'ColorizerToggle'
}
}

View 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' },
}
}

View 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
}

View File

@ -0,0 +1,5 @@
return {
'p00f/nvim-ts-rainbow',
dependencies = 'nvim-treesitter/nvim-treesitter',
event = 'VeryLazy'
}

4
lua/plugins/octo.lua Normal file
View File

@ -0,0 +1,4 @@
return { 'pwntester/octo.nvim',
cmd = 'Octo',
config = true,
}

31
lua/plugins/oil.lua Normal file
View 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
View 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
View 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
View 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
}

View 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',
}

View 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
View File

@ -0,0 +1,12 @@
return {
'folke/which-key.nvim',
opts = {
plugins = {
marks = false,
registers = false,
presets = {
operators = false
}
}
}
}

View File

@ -1,16 +1,12 @@
local utils = { } local utils = {}
local scopes = {o = vim.o, b = vim.bo, w = vim.wo} local scopes = { o = vim.o, b = vim.bo, w = vim.wo }
function utils.opt(scope, key, value) function utils.opt(scope, key, value)
scopes[scope][key] = value scopes[scope][key] = value
if scope ~= 'o' then scopes['o'][key] = value end if scope ~= 'o' then
scopes['o'][key] = value
end
end end
function utils.map(mode, lhs, rhs, opts) return utils
local options = {noremap = true}
if opts then options = vim.tbl_extend('force', options, opts) end
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
end
return utils

122
lua/utils/python_venv.lua Normal file
View 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

0
my-snippets/all.json Normal file
View File

12
my-snippets/cpp.json Normal file
View File

@ -0,0 +1,12 @@
{
"test_getter": {
"prefix": "test_getter",
"body": [
"TEST(${1:TestClass}, ${2:TestFunction}",
"{",
"\tget${CLIPBOARD}()",
"};"
],
"description": "Code snippet for testing the getter"
}
}

19
my-snippets/package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "my-snippets",
"contributes": {
"snippets": [
{
"language": [
"all"
],
"path": "all.json"
},
{
"language": [
"cpp"
],
"path": "cpp.json"
}
]
}
}

14
my_snippets/cpp.json Normal file
View 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
View 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
View 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
View File

@ -0,0 +1,4 @@
{
"venvPath": ".",
"venv": "venvVis"
}

1
snapshots/stable.json Normal file
View File

@ -0,0 +1 @@
{"litee.nvim": {"commit": "de1a3d6"}, "nvim-dap": {"commit": "f4a3be5"}, "telescope-fzf-native.nvim": {"commit": "6a33ece"}, "packer.nvim": {"commit": "d268d2e"}, "tabout.nvim": {"commit": "be655cc"}, "nvim-lspconfig": {"commit": "b9c375c"}, "command-center.nvim": {"commit": "baaf831"}, "nvim-cmp": {"commit": "9897465"}, "clangd_extensions.nvim": {"commit": "81b56d4"}, "cmp-emoji": {"commit": "19075c3"}, "null-ls.nvim": {"commit": "a2b7bf8"}, "lualine.nvim": {"commit": "5113cdb"}, "cmp-cmdline": {"commit": "c36ca4b"}, "nvim-treesitter-textobjects": {"commit": "c8a393e"}, "cmp-nvim-lsp": {"commit": "affe808"}, "cmp_luasnip": {"commit": "a9de941"}, "friendly-snippets": {"commit": "15ecafe"}, "gitsigns.nvim": {"commit": "4883988"}, "dressing.nvim": {"commit": "af17983"}, "indent-blankline.nvim": {"commit": "4a58fe6"}, "lspkind-nvim": {"commit": "57e5b5d"}, "neo-tree.nvim": {"commit": "8613c45"}, "cmp-nvim-lsp-signature-help": {"commit": "007dd27"}, "cmp-look": {"commit": "b39c50b"}, "telescope.nvim": {"commit": "6ea1063"}, "litee-calltree.nvim": {"commit": "71f7eee"}, "lsp_signature.nvim": {"commit": "9c51678"}, "Comment.nvim": {"commit": "4086630"}, "cmp-spell": {"commit": "5602f1a"}, "yanky.nvim": {"commit": "521b94d"}, "gruvbox.nvim": {"commit": "79419f9"}, "gh.nvim": {"commit": "cdf177c"}, "aerial.nvim": {"commit": "bd6de88"}, "neovim-cmake": {"commit": "d0ffe31"}, "nvim-autopairs": {"commit": "4a95b39"}, "LuaSnip": {"commit": "295cc9e"}, "popup.nvim": {"commit": "b7404d3"}, "litee-symboltree.nvim": {"commit": "8f13d50"}, "nvim-web-devicons": {"commit": "8d2c533"}, "nvim-treesitter": {"commit": "cf6d84b"}, "nui.nvim": {"commit": "4af402d"}, "nvim-terminal": {"commit": "e058de4"}, "cmp-treesitter": {"commit": "c2886bb"}, "neogen": {"commit": "c5a0c39"}, "nvim-lsp-installer": {"commit": "12e7c06"}, "cmp-calc": {"commit": "f7efc20"}, "toggleterm.nvim": {"commit": "04174e1"}, "plenary.nvim": {"commit": "46e8bb9"}, "project.nvim": {"commit": "541115e"}, "cmp-nvim-lua": {"commit": "d276254"}, "nvim-ts-rainbow": {"commit": "837167f"}, "cmp-path": {"commit": "981baf9"}, "cmp-buffer": {"commit": "62fc67a"}}

1
snapshots/working.json Normal file
View File

@ -0,0 +1 @@
{"litee.nvim": {"commit": "d346001"}, "nvim-dap": {"commit": "66d33b7"}, "telescope-fzf-native.nvim": {"commit": "6a33ece"}, "packer.nvim": {"commit": "afab895"}, "nvim-lspconfig": {"commit": "a78831f"}, "command-center.nvim": {"commit": "31468fd"}, "clangd_extensions.nvim": {"commit": "2390bf7"}, "nvim-dap-virtual-text": {"commit": "2971ce3"}, "null-ls.nvim": {"commit": "53622ed"}, "mason-lspconfig.nvim": {"commit": "3cbd87f"}, "lualine.nvim": {"commit": "4b5048a"}, "cmp-cmdline": {"commit": "9c0e331"}, "hlargs.nvim": {"commit": "f603d88"}, "aerial.nvim": {"commit": "1abd19b"}, "nvim-autopairs": {"commit": "ca89ab9"}, "cmp_luasnip": {"commit": "a9de941"}, "friendly-snippets": {"commit": "7339def"}, "leap.nvim": {"commit": "b9bc061"}, "gitsigns.nvim": {"commit": "1e107c9"}, "dressing.nvim": {"commit": "d886a1b"}, "indent-blankline.nvim": {"commit": "c15bbe9"}, "lspkind-nvim": {"commit": "57e5b5d"}, "neo-tree.nvim": {"commit": "a922c3a"}, "cmp-nvim-lsp-signature-help": {"commit": "57c4db7"}, "cmp-look": {"commit": "b39c50b"}, "telescope.nvim": {"commit": "4725867"}, "litee-calltree.nvim": {"commit": "7779988"}, "lsp_signature.nvim": {"commit": "4665921"}, "Comment.nvim": {"commit": "fe9bbdb"}, "cmp-spell": {"commit": "5602f1a"}, "yanky.nvim": {"commit": "d55f095"}, "mason.nvim": {"commit": "6171213"}, "gh.nvim": {"commit": "a675ce6"}, "nvim-treesitter-textobjects": {"commit": "b8df8b0"}, "neovim-cmake": {"commit": "338fd2a"}, "cmp-nvim-lsp": {"commit": "affe808"}, "LuaSnip": {"commit": "c599c56"}, "nvim-dap-ui": {"commit": "225115a"}, "popup.nvim": {"commit": "b7404d3"}, "litee-symboltree.nvim": {"commit": "426d4db"}, "nvim-web-devicons": {"commit": "2d02a56"}, "vim-repeat": {"commit": "24afe92"}, "cmp-dap": {"commit": "e21f0e5"}, "nvim-treesitter": {"commit": "501db14"}, "nui.nvim": {"commit": "9531977"}, "nvim-terminal": {"commit": "e058de4"}, "gruvbox-baby": {"commit": "a7dd15a"}, "cmp-emoji": {"commit": "19075c3"}, "cmp-treesitter": {"commit": "c2886bb"}, "neogen": {"commit": "c5a0c39"}, "project.nvim": {"commit": "090bb11"}, "cmp-calc": {"commit": "f7efc20"}, "nvim-dap-python": {"commit": "86d2636"}, "toggleterm.nvim": {"commit": "dfce846"}, "plenary.nvim": {"commit": "31807ee"}, "nvim-cmp": {"commit": "b588569"}, "telescope-dap.nvim": {"commit": "b4134ff"}, "cmp-path": {"commit": "447c87c"}, "nvim-ts-rainbow": {"commit": "d16220f"}, "cmp-nvim-lua": {"commit": "d276254"}, "cmp-buffer": {"commit": "62fc67a"}}

6
stylua.toml Normal file
View File

@ -0,0 +1,6 @@
column_width = 120
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 2
quote_style = "AutoPreferSingle"
call_parentheses = "Always"