@@ -166,6 +166,22 @@ vim.o.scrolloff = 10
166
166
-- See `:help 'confirm'`
167
167
vim .o .confirm = true
168
168
169
+ vim .o .tabstop = 4
170
+ vim .o .shiftwidth = 2
171
+ vim .o .colorcolumn = ' 80'
172
+
173
+ -- move lines keymap
174
+
175
+ vim .keymap .set (' v' , ' J' , " :m '>+1<CR>gv=gv" , { desc = ' Move line down' })
176
+ vim .keymap .set (' v' , ' K' , " :m '<-2<CR>gv=gv" , { desc = ' Move line up ' })
177
+
178
+ -- move record macro to Q instead of q
179
+ vim .keymap .set (' n' , ' Q' , ' q' , opts )
180
+ vim .keymap .set (' n' , ' q' , ' <Nop>' , opts )
181
+
182
+ -- open project view
183
+ vim .keymap .set (' n' , ' <leader>pv' , vim .cmd .Ex , { desc = ' Open [P]roject [V]iew' })
184
+
169
185
-- [[ Basic Keymaps ]]
170
186
-- See `:help vim.keymap.set()`
171
187
@@ -185,10 +201,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
185
201
vim .keymap .set (' t' , ' <Esc><Esc>' , ' <C-\\ ><C-n>' , { desc = ' Exit terminal mode' })
186
202
187
203
-- TIP: Disable arrow keys in normal mode
188
- -- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
189
- -- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
190
- -- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
191
- -- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
204
+ vim .keymap .set (' n' , ' <left>' , ' <cmd>echo "Use h to move!!"<CR>' )
205
+ vim .keymap .set (' n' , ' <right>' , ' <cmd>echo "Use l to move!!"<CR>' )
206
+ vim .keymap .set (' n' , ' <up>' , ' <cmd>echo "Use k to move!!"<CR>' )
207
+ vim .keymap .set (' n' , ' <down>' , ' <cmd>echo "Use j to move!!"<CR>' )
192
208
193
209
-- Keybinds to make split navigation easier.
194
210
-- Use CTRL+<hjkl> to switch between windows
@@ -198,7 +214,6 @@ vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left wind
198
214
vim .keymap .set (' n' , ' <C-l>' , ' <C-w><C-l>' , { desc = ' Move focus to the right window' })
199
215
vim .keymap .set (' n' , ' <C-j>' , ' <C-w><C-j>' , { desc = ' Move focus to the lower window' })
200
216
vim .keymap .set (' n' , ' <C-k>' , ' <C-w><C-k>' , { desc = ' Move focus to the upper window' })
201
-
202
217
-- NOTE: Some terminals have colliding keymaps or are not able to send distinct keycodes
203
218
-- vim.keymap.set("n", "<C-S-h>", "<C-w>H", { desc = "Move window to the left" })
204
219
-- vim.keymap.set("n", "<C-S-l>", "<C-w>L", { desc = "Move window to the right" })
@@ -347,6 +362,8 @@ require('lazy').setup({
347
362
{ ' <leader>s' , group = ' [S]earch' },
348
363
{ ' <leader>t' , group = ' [T]oggle' },
349
364
{ ' <leader>h' , group = ' Git [H]unk' , mode = { ' n' , ' v' } },
365
+ { ' <leader>h' , group = ' [H]arpoon' , mode = { ' n' } },
366
+ { ' <leader>p' , group = ' [P]roject' , mode = { ' n' } },
350
367
},
351
368
},
352
369
},
@@ -684,6 +701,8 @@ require('lazy').setup({
684
701
-- ts_ls = {},
685
702
--
686
703
704
+ vue_ls = {},
705
+
687
706
lua_ls = {
688
707
-- cmd = { ... },
689
708
-- filetypes = { ... },
@@ -729,7 +748,6 @@ require('lazy').setup({
729
748
-- by the server configuration above. Useful when disabling
730
749
-- certain features of an LSP (for example, turning off formatting for ts_ls)
731
750
server .capabilities = vim .tbl_deep_extend (' force' , {}, capabilities , server .capabilities or {})
732
- require (' lspconfig' )[server_name ].setup (server )
733
751
end ,
734
752
},
735
753
}
@@ -772,7 +790,10 @@ require('lazy').setup({
772
790
-- python = { "isort", "black" },
773
791
--
774
792
-- You can use 'stop_after_first' to run the first available formatter from the list
775
- -- javascript = { "prettierd", "prettier", stop_after_first = true },
793
+ javascript = { ' prettierd' , ' prettier' , stop_after_first = true },
794
+ typescript = { ' prettierd' , ' prettier' , stop_after_first = true },
795
+ vue = { ' prettierd' , ' prettier' , stop_after_first = true },
796
+ nix = { ' alejandra' },
776
797
},
777
798
},
778
799
},
@@ -899,7 +920,12 @@ require('lazy').setup({
899
920
},
900
921
901
922
-- Highlight todo, notes, etc in comments
902
- { ' folke/todo-comments.nvim' , event = ' VimEnter' , dependencies = { ' nvim-lua/plenary.nvim' }, opts = { signs = false } },
923
+ {
924
+ ' folke/todo-comments.nvim' ,
925
+ event = ' VimEnter' ,
926
+ dependencies = { ' nvim-lua/plenary.nvim' },
927
+ opts = { signs = false , keywords = { TODO = { alt = { ' CSAH' } } } },
928
+ },
903
929
904
930
{ -- Collection of various small independent plugins/modules
905
931
' echasnovski/mini.nvim' ,
@@ -963,6 +989,49 @@ require('lazy').setup({
963
989
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
964
990
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
965
991
},
992
+ -- Harpoon with telescope enabled
993
+ {
994
+ ' ThePrimeagen/harpoon' ,
995
+ branch = ' harpoon2' ,
996
+ dependencies = { ' nvim-lua/plenary.nvim' },
997
+ config = function ()
998
+ local harpoon = require ' harpoon'
999
+
1000
+ -- REQUIRED
1001
+ harpoon :setup ()
1002
+ -- REQUIRED
1003
+ -- basic telescope configuration
1004
+ local conf = require (' telescope.config' ).values
1005
+ local function toggle_telescope (harpoon_files )
1006
+ local file_paths = {}
1007
+ for _ , item in ipairs (harpoon_files .items ) do
1008
+ table.insert (file_paths , item .value )
1009
+ end
1010
+
1011
+ require (' telescope.pickers' )
1012
+ .new ({}, {
1013
+ prompt_title = ' Harpoon' ,
1014
+ finder = require (' telescope.finders' ).new_table {
1015
+ results = file_paths ,
1016
+ },
1017
+ previewer = conf .file_previewer {},
1018
+ sorter = conf .generic_sorter {},
1019
+ })
1020
+ :find ()
1021
+ end
1022
+
1023
+ -- basic telescope configuration
1024
+ vim .keymap .set (' n' , ' <leader>ha' , function ()
1025
+ harpoon :list ():add ()
1026
+ end , { desc = ' [H]arpoon [A]dd' })
1027
+ vim .keymap .set (' n' , ' <leader>hs' , function ()
1028
+ toggle_telescope (harpoon :list ())
1029
+ end , { desc = ' [H]arpoon [S]how' })
1030
+ vim .keymap .set (' n' , ' <leader>he' , function ()
1031
+ harpoon .ui :toggle_quick_menu (harpoon :list ())
1032
+ end , { desc = ' [H]arpoon [E]dit' })
1033
+ end ,
1034
+ },
966
1035
967
1036
-- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the
968
1037
-- init.lua. If you want these files, they are in the repository, so you can just download them and
@@ -1011,6 +1080,15 @@ require('lazy').setup({
1011
1080
},
1012
1081
},
1013
1082
})
1014
-
1083
+ vim .lsp .config (' vue_ls' , {
1084
+ filetypes = { ' typescript' , ' javascript' , ' javascriptreact' , ' typescriptreact' , ' vue' },
1085
+ init_options = {
1086
+ vue = {
1087
+ hybridMode = false ,
1088
+ },
1089
+ },
1090
+ capabilities = require (' blink.cmp' ).get_lsp_capabilities (),
1091
+ })
1092
+ vim .lsp .enable ' vue_ls'
1015
1093
-- The line beneath this is called `modeline`. See `:help modeline`
1016
1094
-- vim: ts=2 sts=2 sw=2 et
0 commit comments