@@ -143,15 +143,20 @@ require('lazy').setup({
143143 },
144144 config = function ()
145145 -- [[ Configure Telescope ]]
146+ local actions = {}
146147 require (' telescope' ).setup {
147148 -- You can put your default mappings / updates / etc. in here
148149 -- All the info you're looking for is in `:help telescope.setup()`
149150 --
150- -- defaults = {
151- -- mappings = {
152- -- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
153- -- },
154- -- },
151+ defaults = {
152+ mappings = {
153+ i = {
154+ [' <c-enter>' ] = ' to_fuzzy_refine' ,
155+ [' <C-j>' ] = ' move_selection_next' ,
156+ [' <C-k>' ] = ' move_selection_previous' ,
157+ },
158+ },
159+ },
155160 -- pickers = {}
156161 extensions = {
157162 [' ui-select' ] = {
@@ -164,14 +169,36 @@ require('lazy').setup({
164169 pcall (require (' telescope' ).load_extension , ' fzf' )
165170 pcall (require (' telescope' ).load_extension , ' ui-select' )
166171
172+ -- Available Telescope themes:
173+ -- get_dropdown() - A dropdown menu style with a floating window
174+ -- get_cursor() - A cursor-based selection style with a floating window
175+ -- get_ivy() - The Ivy style with a vertical list layout
176+ -- get_center() - A centered layout with a floating window
177+
167178 -- See `:help telescope.builtin`
168179 local builtin = require ' telescope.builtin'
169180 vim .keymap .set (' n' , ' <leader>sh' , builtin .help_tags , { desc = ' [S]earch [H]elp' })
170181 vim .keymap .set (' n' , ' <leader>sk' , builtin .keymaps , { desc = ' [S]earch [K]eymaps' })
171- vim .keymap .set (' n' , ' <leader>sf' , builtin .find_files , { desc = ' [S]earch [F]iles' })
182+
183+ vim .keymap .set (' n' , ' <leader>sf' , function ()
184+ builtin .find_files (require (' telescope.themes' ).get_dropdown ())
185+ end , { desc = ' [S]earch [F]iles' })
186+
187+ vim .keymap .set (' n' , ' <leader>f' , function ()
188+ builtin .find_files (require (' telescope.themes' ).get_dropdown ())
189+ end , { desc = ' [S]earch [F]iles' })
190+
191+ vim .keymap .set (' n' , ' <leader>sg' , function ()
192+ builtin .live_grep (require (' telescope.themes' ).get_ivy ())
193+ end , { desc = ' [S]earch by [G]rep' })
194+
195+ vim .keymap .set (' n' , ' <leader>F' , function ()
196+ builtin .live_grep (require (' telescope.themes' ).get_ivy ())
197+ end , { desc = ' [S]earch by [G]rep' })
198+
172199 vim .keymap .set (' n' , ' <leader>ss' , builtin .builtin , { desc = ' [S]earch [S]elect Telescope' })
173200 vim .keymap .set (' n' , ' <leader>sw' , builtin .grep_string , { desc = ' [S]earch current [W]ord' })
174- vim .keymap .set (' n' , ' <leader>sg' , builtin .live_grep , { desc = ' [S]earch by [G]rep' })
201+ -- vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
175202 vim .keymap .set (' n' , ' <leader>sd' , builtin .diagnostics , { desc = ' [S]earch [D]iagnostics' })
176203 vim .keymap .set (' n' , ' <leader>sr' , builtin .resume , { desc = ' [S]earch [R]esume' })
177204 vim .keymap .set (' n' , ' <leader>s.' , builtin .oldfiles , { desc = ' [S]earch Recent Files ("." for repeat)' })
@@ -224,31 +251,6 @@ require('lazy').setup({
224251 ' hrsh7th/cmp-nvim-lsp' ,
225252 },
226253 config = function ()
227- -- Brief aside: **What is LSP?**
228- --
229- -- LSP is an initialism you've probably heard, but might not understand what it is.
230- --
231- -- LSP stands for Language Server Protocol. It's a protocol that helps editors
232- -- and language tooling communicate in a standardized fashion.
233- --
234- -- In general, you have a "server" which is some tool built to understand a particular
235- -- language (such as `gopls`, `lua_ls`, `rust_analyzer`, etc.). These Language Servers
236- -- (sometimes called LSP servers, but that's kind of like ATM Machine) are standalone
237- -- processes that communicate with some "client" - in this case, Neovim!
238- --
239- -- LSP provides Neovim with features like:
240- -- - Go to definition
241- -- - Find references
242- -- - Autocompletion
243- -- - Symbol Search
244- -- - and more!
245- --
246- -- Thus, Language Servers are external tools that must be installed separately from
247- -- Neovim. This is where `mason` and related plugins come into play.
248- --
249- -- If you're wondering about lsp vs treesitter, you can check out the wonderfully
250- -- and elegantly composed help section, `:help lsp-vs-treesitter`
251-
252254 -- This function gets run when an LSP attaches to a particular buffer.
253255 -- That is to say, every time a new file is opened that is associated with
254256 -- an lsp (for example, opening `main.rs` is associated with `rust_analyzer`) this
@@ -289,20 +291,23 @@ require('lazy').setup({
289291
290292 -- Fuzzy find all the symbols in your current workspace.
291293 -- Similar to document symbols, except searches over your entire project.
292- map (' <leader>ws' , require (' telescope.builtin' ).lsp_dynamic_workspace_symbols , ' [W]orkspace [S]ymbols' )
294+ -- map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
293295
294296 -- Rename the variable under your cursor.
295297 -- Most Language Servers support renaming across files, etc.
296298 map (' <leader>rn' , vim .lsp .buf .rename , ' [R]e[n]ame' )
297299
298300 -- Execute a code action, usually your cursor needs to be on top of an error
299301 -- or a suggestion from your LSP for this to activate.
300- map (' <leader>ca' , vim .lsp .buf .code_action , ' [C]ode [A]ction' , { ' n' , ' x' })
302+ -- i will comment this out becouse of close <space>c
303+ -- map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
301304
302305 -- WARN: This is not Goto Definition, this is Goto Declaration.
303306 -- For example, in C this would take you to the header.
304307 map (' gD' , vim .lsp .buf .declaration , ' [G]oto [D]eclaration' )
305308
309+ vim .diagnostic .config { virtual_text = false }
310+
306311 -- This function resolves a difference between neovim nightly (version 0.11) and stable (version 0.10)
307312 --- @param client vim.lsp.Client
308313 --- @param method vim.lsp.protocol.Method
@@ -531,12 +536,12 @@ require('lazy').setup({
531536 -- `friendly-snippets` contains a variety of premade snippets.
532537 -- See the README about individual language/framework/plugin snippets:
533538 -- https://github.com/rafamadriz/friendly-snippets
534- -- {
535- -- 'rafamadriz/friendly-snippets',
536- -- config = function()
537- -- require('luasnip.loaders.from_vscode').lazy_load()
538- -- end,
539- -- },
539+ {
540+ ' rafamadriz/friendly-snippets' ,
541+ config = function ()
542+ require (' luasnip.loaders.from_vscode' ).lazy_load ()
543+ end ,
544+ },
540545 },
541546 },
542547 ' saadparwaiz1/cmp_luasnip' ,
@@ -585,7 +590,7 @@ require('lazy').setup({
585590
586591 -- If you prefer more traditional completion keymaps,
587592 -- you can uncomment the following lines
588- -- ['<CR>'] = cmp.mapping.confirm { select = true },
593+ [' <CR>' ] = cmp .mapping .confirm { select = true },
589594 -- ['<Tab>'] = cmp.mapping.select_next_item(),
590595 -- ['<S-Tab>'] = cmp.mapping.select_prev_item(),
591596
@@ -631,34 +636,22 @@ require('lazy').setup({
631636 end ,
632637 },
633638
634- { -- You can easily change to a different colorscheme.
635- -- Change the name of the colorscheme plugin below, and then
636- -- change the command in the config to whatever the name of that colorscheme is.
637- --
638- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
639- ' folke/tokyonight.nvim' ,
640- priority = 1000 , -- Make sure to load this before all the other start plugins.
641- config = function ()
642- --- @diagnostic disable-next-line : missing-fields
643- require (' tokyonight' ).setup {
644- styles = {
645- comments = { italic = false }, -- Disable italics in comments
646- },
647- }
648-
649- -- Load the colorscheme here.
650- -- Like many other themes, this one has different styles, and you could load
651- -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
652- vim .cmd .colorscheme ' tokyonight-night'
653- end ,
654- },
655-
656639 -- Highlight todo, notes, etc in comments
657640 { ' folke/todo-comments.nvim' , event = ' VimEnter' , dependencies = { ' nvim-lua/plenary.nvim' }, opts = { signs = false } },
658-
659641 { -- Collection of various small independent plugins/modules
660642 ' echasnovski/mini.nvim' ,
661643 config = function ()
644+ local gen_loader = require (' mini.snippets' ).gen_loader
645+ require (' mini.snippets' ).setup {
646+ snippets = {
647+ -- Load custom file with global snippets first (adjust for Windows)
648+ gen_loader .from_file ' ~/.config/nvim/snippets/global.json' ,
649+
650+ -- Load snippets based on current language by reading files from
651+ -- "snippets/" subdirectories from 'runtimepath' directories.
652+ gen_loader .from_lang (),
653+ },
654+ }
662655 -- Better Around/Inside textobjects
663656 --
664657 -- Examples:
@@ -769,3 +762,6 @@ require('lazy').setup({
769762
770763-- The line beneath this is called `modeline`. See `:help modeline`
771764-- vim: ts=2 sts=2 sw=2 et
765+
766+ -- load after plugins
767+ require ' custom.colors'
0 commit comments