From e739799fb61e662dc704abf020ea4f263e3ec3c9 Mon Sep 17 00:00:00 2001 From: grimhilt Date: Thu, 29 Aug 2024 17:26:46 +0200 Subject: [PATCH] feat(nvim): mini files and rust opti --- .config/nvim/init.lua | 976 ++++++++++++++------------- .config/nvim/lazy-lock.json | 40 +- .config/nvim/plugin/harpoon.lua | 22 +- .config/nvim/plugin/minifiles.lua | 52 ++ .config/nvim/plugin/rustaceanvim.lua | 50 ++ .config/nvim/plugin/telescope.lua | 13 + 6 files changed, 668 insertions(+), 485 deletions(-) create mode 100644 .config/nvim/plugin/minifiles.lua create mode 100644 .config/nvim/plugin/rustaceanvim.lua diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index dcfa96e..4f8afd2 100755 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -23,7 +23,7 @@ vim.o.mouse = 'a' -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` vim.schedule(function() - vim.opt.clipboard = 'unnamedplus' + vim.opt.clipboard = 'unnamedplus' end) vim.o.clipboard = 'unnamedplus' vim.opt.clipboard = 'unnamedplus' @@ -62,7 +62,7 @@ vim.o.scrolloff = 8 vim.g.rustfmt_autosave = 1 -- --- vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "pv", vim.cmd.Ex) vim.keymap.set("n", "h", ":noh") --move line shortcut @@ -111,14 +111,14 @@ vim.keymap.set("n", "w", function() vim.o.wrap = not vim.o.wrap end, {no -- `:help lazy.nvim.txt` for more info 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', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release - lazypath, - } + vim.fn.system { + 'git', + 'clone', + '--filter=blob:none', + 'https://github.com/folke/lazy.nvim.git', + '--branch=stable', -- latest stable release + lazypath, + } end vim.opt.rtp:prepend(lazypath) @@ -129,245 +129,309 @@ vim.opt.rtp:prepend(lazypath) -- You can also configure plugins after the setup call, -- as they will be available in your neovim runtime. require('lazy').setup({ - -- NOTE: First, some plugins that don't require any configuration + -- NOTE: First, some plugins that don't require any configuration - -- Git related plugins - 'tpope/vim-fugitive', - 'tpope/vim-rhubarb', + -- Git related plugins + 'tpope/vim-fugitive', + 'tpope/vim-rhubarb', - -- harpoon - 'nvim-lua/plenary.nvim', - 'ThePrimeagen/harpoon', - - -- Mini - { 'echasnovski/mini.files', version = false }, - - -- Detect tabstop and shiftwidth automatically - -- 'tpope/vim-sleuth', - - -- NOTE: This is where your plugins related to LSP can be installed. - -- The configuration is done below. Search for lspconfig to find it below. - { - -- LSP Configuration & Plugins - 'neovim/nvim-lspconfig', - dependencies = { - -- Automatically install LSPs to stdpath for neovim - { 'williamboman/mason.nvim', config = true }, - 'williamboman/mason-lspconfig.nvim', - - -- Useful status updates for LSP - -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', opts = {} }, - - -- Additional lua configuration, makes nvim stuff amazing! - 'folke/neodev.nvim', + -- harpoon + -- { + -- 'ThePrimeagen/harpoon', + -- branch = "harpoon2", + -- dependencies = { "nvim-lua/plenary.nvim" } + -- }, + { + 'ThePrimeagen/harpoon', + branch = 'harpoon2', + opts = { + menu = { + width = vim.api.nvim_win_get_width(0) - 4, + }, + }, + keys = { + { + 'q', + function() + require('harpoon'):list():add() + end, + desc = 'Harpoon File', + }, + { + '', + function() + local harpoon = require('harpoon') + harpoon.ui:toggle_quick_menu(harpoon:list()) + end, + desc = 'Harpoon Quick Menu', + }, + { + '', + function() + require('harpoon'):list():select(1) + end, + desc = 'Harpoon to File 1', + }, + { + '', + function() + require('harpoon'):list():select(2) + end, + desc = 'Harpoon to File 2', + }, + { + '', + function() + require('harpoon'):list():select(3) + end, + desc = 'Harpoon to File 3', + }, + { + '', + function() + require('harpoon'):list():select(4) + end, + desc = 'Harpoon to File 4', + }, + { + '', + function() + require('harpoon'):list():select(5) + end, + desc = 'Harpoon to File 5', + }, + }, }, - }, - { - -- Autocompletion - 'hrsh7th/nvim-cmp', - dependencies = { - -- Snippet Engine & its associated nvim-cmp source - { - 'L3MON4D3/LuaSnip', - build = (function() - -- Build Step is needed for regex support in snippets - -- This step is not supported in many windows environments - -- Remove the below condition to re-enable on windows - if vim.fn.has 'win32' == 1 then - return - end - return 'make install_jsregexp' - end)(), - }, - 'saadparwaiz1/cmp_luasnip', + -- Mini + { 'echasnovski/mini.files', version = false }, - -- Adds LSP completion capabilities - 'hrsh7th/cmp-nvim-lsp', - 'hrsh7th/cmp-path', + -- Detect tabstop and shiftwidth automatically + -- 'tpope/vim-sleuth', - -- Adds a number of user-friendly snippets - 'rafamadriz/friendly-snippets', + -- NOTE: This is where your plugins related to LSP can be installed. + -- The configuration is done below. Search for lspconfig to find it below. + { + -- LSP Configuration & Plugins + 'neovim/nvim-lspconfig', + dependencies = { + -- Automatically install LSPs to stdpath for neovim + { 'williamboman/mason.nvim', config = true }, + 'williamboman/mason-lspconfig.nvim', + + -- Useful status updates for LSP + -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` + { 'j-hui/fidget.nvim', opts = {} }, + + -- Additional lua configuration, makes nvim stuff amazing! + 'folke/neodev.nvim', + }, }, - }, - -- auto pair - { - "windwp/nvim-autopairs", - config = function() require("nvim-autopairs").setup {} end - }, + { + -- Autocompletion + 'hrsh7th/nvim-cmp', + dependencies = { + -- Snippet Engine & its associated nvim-cmp source + { + 'L3MON4D3/LuaSnip', + build = (function() + -- Build Step is needed for regex support in snippets + -- This step is not supported in many windows environments + -- Remove the below condition to re-enable on windows + if vim.fn.has 'win32' == 1 then + return + end + return 'make install_jsregexp' + end)(), + }, + 'saadparwaiz1/cmp_luasnip', - -- Rust - "simrat39/rust-tools.nvim", + -- Adds LSP completion capabilities + 'hrsh7th/cmp-nvim-lsp', + 'hrsh7th/cmp-path', - -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, - --{ - -- -- Adds git related signs to the gutter, as well as utilities for managing changes - -- 'lewis6991/gitsigns.nvim', - -- opts = { - -- -- See `:help gitsigns.txt` - -- signs = { - -- add = { text = '+' }, - -- change = { text = '~' }, - -- delete = { text = '_' }, - -- topdelete = { text = '‾' }, - -- changedelete = { text = '~' }, - -- }, - -- on_attach = function(bufnr) - -- local gs = package.loaded.gitsigns + -- Adds a number of user-friendly snippets + 'rafamadriz/friendly-snippets', + }, + }, - -- local function map(mode, l, r, opts) - -- opts = opts or {} - -- opts.buffer = bufnr - -- vim.keymap.set(mode, l, r, opts) - -- end + -- auto pair + { + "windwp/nvim-autopairs", + config = function() require("nvim-autopairs").setup {} end + }, - -- -- Navigation - -- map({ 'n', 'v' }, ']c', function() - -- if vim.wo.diff then - -- return ']c' - -- end - -- vim.schedule(function() - -- gs.next_hunk() - -- end) - -- return '' - -- end, { expr = true, desc = 'Jump to next hunk' }) + -- Rust + "simrat39/rust-tools.nvim", - -- map({ 'n', 'v' }, '[c', function() - -- if vim.wo.diff then - -- return '[c' - -- end - -- vim.schedule(function() - -- gs.prev_hunk() - -- end) - -- return '' - -- end, { expr = true, desc = 'Jump to previous hunk' }) + -- Useful plugin to show you pending keybinds. + -- { 'folke/which-key.nvim', opts = {} }, + --{ + -- -- Adds git related signs to the gutter, as well as utilities for managing changes + -- 'lewis6991/gitsigns.nvim', + -- opts = { + -- -- See `:help gitsigns.txt` + -- signs = { + -- add = { text = '+' }, + -- change = { text = '~' }, + -- delete = { text = '_' }, + -- topdelete = { text = '‾' }, + -- changedelete = { text = '~' }, + -- }, + -- on_attach = function(bufnr) + -- local gs = package.loaded.gitsigns - -- -- Actions - -- -- visual mode - -- map('v', 'hs', function() - -- gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } - -- end, { desc = 'stage git hunk' }) - -- map('v', 'hr', function() - -- gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } - -- end, { desc = 'reset git hunk' }) - -- -- normal mode - -- map('n', 'hs', gs.stage_hunk, { desc = 'git stage hunk' }) - -- map('n', 'hr', gs.reset_hunk, { desc = 'git reset hunk' }) - -- map('n', 'hS', gs.stage_buffer, { desc = 'git Stage buffer' }) - -- map('n', 'hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) - -- map('n', 'hR', gs.reset_buffer, { desc = 'git Reset buffer' }) - -- map('n', 'hp', gs.preview_hunk, { desc = 'preview git hunk' }) - -- map('n', 'hb', function() - -- gs.blame_line { full = false } - -- end, { desc = 'git blame line' }) - -- map('n', 'hd', gs.diffthis, { desc = 'git diff against index' }) - -- map('n', 'hD', function() - -- gs.diffthis '~' - -- end, { desc = 'git diff against last commit' }) + -- local function map(mode, l, r, opts) + -- opts = opts or {} + -- opts.buffer = bufnr + -- vim.keymap.set(mode, l, r, opts) + -- end - -- -- Toggles - -- map('n', 'tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) - -- map('n', 'td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) + -- -- Navigation + -- map({ 'n', 'v' }, ']c', function() + -- if vim.wo.diff then + -- return ']c' + -- end + -- vim.schedule(function() + -- gs.next_hunk() + -- end) + -- return '' + -- end, { expr = true, desc = 'Jump to next hunk' }) - -- -- Text object - -- map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) - -- end, - -- }, - --}, + -- map({ 'n', 'v' }, '[c', function() + -- if vim.wo.diff then + -- return '[c' + -- end + -- vim.schedule(function() + -- gs.prev_hunk() + -- end) + -- return '' + -- end, { expr = true, desc = 'Jump to previous hunk' }) - { - -- Theme inspired by Atom - 'navarasu/onedark.nvim', - priority = 1000, - lazy = false, - config = function() - require('onedark').setup { - -- Set a style preset. 'dark' is default. - style = 'dark', -- dark, darker, cool, deep, warm, warmer, light - } - require('onedark').load() - end, - }, + -- -- Actions + -- -- visual mode + -- map('v', 'hs', function() + -- gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } + -- end, { desc = 'stage git hunk' }) + -- map('v', 'hr', function() + -- gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } + -- end, { desc = 'reset git hunk' }) + -- -- normal mode + -- map('n', 'hs', gs.stage_hunk, { desc = 'git stage hunk' }) + -- map('n', 'hr', gs.reset_hunk, { desc = 'git reset hunk' }) + -- map('n', 'hS', gs.stage_buffer, { desc = 'git Stage buffer' }) + -- map('n', 'hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) + -- map('n', 'hR', gs.reset_buffer, { desc = 'git Reset buffer' }) + -- map('n', 'hp', gs.preview_hunk, { desc = 'preview git hunk' }) + -- map('n', 'hb', function() + -- gs.blame_line { full = false } + -- end, { desc = 'git blame line' }) + -- map('n', 'hd', gs.diffthis, { desc = 'git diff against index' }) + -- map('n', 'hD', function() + -- gs.diffthis '~' + -- end, { desc = 'git diff against last commit' }) - -- bar - --{ - -- -- Set lualine as statusline - -- 'nvim-lualine/lualine.nvim', - -- -- See `:help lualine.txt` - -- opts = { - -- options = { - -- icons_enabled = false, - -- theme = 'auto', - -- component_separators = '|', - -- section_separators = '', - -- }, - -- }, - --}, + -- -- Toggles + -- map('n', 'tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) + -- map('n', 'td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) - -- coloration and indentation - --{ - -- -- Add indentation guides even on blank lines - -- 'lukas-reineke/indent-blankline.nvim', - -- -- Enable `lukas-reineke/indent-blankline.nvim` - -- -- See `:help ibl` - -- main = 'ibl', - -- opts = {}, - --}, + -- -- Text object + -- map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk', { desc = 'select git hunk' }) + -- end, + -- }, + --}, - -- `gcc` - Toggles the current line using linewise comment - -- `gbc` - Toggles the current line using blockwise comment - -- `[count]gcc` - Toggles the number of line given as a prefix-count using linewise - -- `[count]gbc` - Toggles the number of line given as a prefix-count using blockwise - -- `gc[count]{motion}` - (Op-pending) Toggles the region using linewise comment - -- `gb[count]{motion}` - (Op-pending) Toggles the region using blockwise comment - { 'numToStr/Comment.nvim', opts = {} }, - - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 + { + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, + lazy = false, + config = function() + require('onedark').setup { + -- Set a style preset. 'dark' is default. + style = 'dark', -- dark, darker, cool, deep, warm, warmer, light + } + require('onedark').load() end, - }, }, - }, - { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', + -- bar + --{ + -- -- Set lualine as statusline + -- 'nvim-lualine/lualine.nvim', + -- -- See `:help lualine.txt` + -- opts = { + -- options = { + -- icons_enabled = false, + -- theme = 'auto', + -- component_separators = '|', + -- section_separators = '', + -- }, + -- }, + --}, + + -- coloration and indentation + --{ + -- -- Add indentation guides even on blank lines + -- 'lukas-reineke/indent-blankline.nvim', + -- -- Enable `lukas-reineke/indent-blankline.nvim` + -- -- See `:help ibl` + -- main = 'ibl', + -- opts = {}, + --}, + + -- `gcc` - Toggles the current line using linewise comment + -- `gbc` - Toggles the current line using blockwise comment + -- `[count]gcc` - Toggles the number of line given as a prefix-count using linewise + -- `[count]gbc` - Toggles the number of line given as a prefix-count using blockwise + -- `gc[count]{motion}` - (Op-pending) Toggles the region using linewise comment + -- `gb[count]{motion}` - (Op-pending) Toggles the region using blockwise comment + { 'numToStr/Comment.nvim', opts = {} }, + + -- Fuzzy Finder (files, lsp, etc) + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + }, }, - build = ':TSUpdate', - }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', + { + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + build = ':TSUpdate', + }, - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- These are some example plugins that I've included in the kickstart repository. + -- Uncomment any of the lines below to enable them. + -- require 'kickstart.plugins.autoformat', + -- require 'kickstart.plugins.debug', + + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping + -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- { import = 'custom.plugins' }, }, {}) -- Keymaps for better default experience @@ -395,57 +459,41 @@ vim.keymap.set('n', 'd', vim.diagnostic.setloclist, { desc = 'Open diagn -- pattern = '*', --}) --- [[ Configure Telescope ]] --- See `:help telescope` and `:help telescope.setup()` -require('telescope').setup { - defaults = { - mappings = { - i = { - [''] = false, - [''] = false, - }, - }, - }, -} - -require('mini.files').setup() -vim.keymap.set("n", "pv", 'lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()', { desc = 'Open MiniFiles' }) - -- Enable telescope fzf native, if installed pcall(require('telescope').load_extension, 'fzf') -- Telescope live_grep in git root -- Function to find the git root directory based on the current buffer's path local function find_git_root() - -- Use the current buffer's path as the starting point for the git search - local current_file = vim.api.nvim_buf_get_name(0) - local current_dir - local cwd = vim.fn.getcwd() - -- If the buffer is not associated with a file, return nil - if current_file == '' then - current_dir = cwd - else - -- Extract the directory from the current file's path - current_dir = vim.fn.fnamemodify(current_file, ':h') - end + -- Use the current buffer's path as the starting point for the git search + local current_file = vim.api.nvim_buf_get_name(0) + local current_dir + local cwd = vim.fn.getcwd() + -- If the buffer is not associated with a file, return nil + if current_file == '' then + current_dir = cwd + else + -- Extract the directory from the current file's path + current_dir = vim.fn.fnamemodify(current_file, ':h') + end - -- Find the Git root directory from the current file's path - local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] - if vim.v.shell_error ~= 0 then - print 'Not a git repository. Searching on current working directory' - return cwd - end - return git_root + -- Find the Git root directory from the current file's path + local git_root = vim.fn.systemlist('git -C ' .. vim.fn.escape(current_dir, ' ') .. ' rev-parse --show-toplevel')[1] + if vim.v.shell_error ~= 0 then + print 'Not a git repository. Searching on current working directory' + return cwd + end + return git_root end -- Custom live_grep function to search in git root local function live_grep_git_root() - local git_root = find_git_root() - if git_root then - require('telescope.builtin').live_grep { - search_dirs = { git_root }, - } - end + local git_root = find_git_root() + if git_root then + require('telescope.builtin').live_grep { + search_dirs = { git_root }, + } + end end vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) @@ -454,18 +502,18 @@ vim.api.nvim_create_user_command('LiveGrepGitRoot', live_grep_git_root, {}) vim.keymap.set('n', '?', require('telescope.builtin').oldfiles, { desc = '[?] Find recently opened files' }) vim.keymap.set('n', '', require('telescope.builtin').buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '/', function() - -- You can pass additional configuration to telescope to change theme, layout, etc. - require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { - winblend = 10, - previewer = false, - }) + -- You can pass additional configuration to telescope to change theme, layout, etc. + require('telescope.builtin').current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { + winblend = 10, + previewer = false, + }) end, { desc = '[/] Fuzzily search in current buffer' }) local function telescope_live_grep_open_files() - require('telescope.builtin').live_grep { - grep_open_files = true, - prompt_title = 'Live Grep in Open Files', - } + require('telescope.builtin').live_grep { + grep_open_files = true, + prompt_title = 'Live Grep in Open Files', + } end vim.keymap.set('n', 's/', telescope_live_grep_open_files, { desc = '[S]earch [/] in Open Files' }) vim.keymap.set('n', 'ss', require('telescope.builtin').builtin, { desc = '[S]earch [S]elect Telescope' }) @@ -482,140 +530,140 @@ vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = -- See `:help nvim-treesitter` -- Defer Treesitter setup after first render to improve startup time of 'nvim {filename}' vim.defer_fn(function() - require('nvim-treesitter.configs').setup { - -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'rust', 'vimdoc', 'vim', 'bash' }, + require('nvim-treesitter.configs').setup { + -- Add languages to be installed here that you want installed for treesitter + ensure_installed = { 'rust', 'vimdoc', 'vim', 'bash' }, - -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) - auto_install = false, - -- Install languages synchronously (only applied to `ensure_installed`) - sync_install = false, - -- List of parsers to ignore installing - ignore_install = {}, - -- You can specify additional Treesitter modules here: -- For example: -- playground = {--enable = true,-- }, - modules = {}, - highlight = { enable = true }, - indent = { enable = true }, - incremental_selection = { - enable = true, - keymaps = { - init_selection = '', - node_incremental = '', - scope_incremental = '', - node_decremental = '', - }, - }, - textobjects = { - select = { - enable = true, - lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim - keymaps = { - -- You can use the capture groups defined in textobjects.scm - ['aa'] = '@parameter.outer', - ['ia'] = '@parameter.inner', - ['af'] = '@function.outer', - ['if'] = '@function.inner', - ['ac'] = '@class.outer', - ['ic'] = '@class.inner', + -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) + auto_install = false, + -- Install languages synchronously (only applied to `ensure_installed`) + sync_install = false, + -- List of parsers to ignore installing + ignore_install = {}, + -- You can specify additional Treesitter modules here: -- For example: -- playground = {--enable = true,-- }, + modules = {}, + highlight = { enable = true }, + indent = { enable = true }, + incremental_selection = { + enable = true, + keymaps = { + init_selection = '', + node_incremental = '', + scope_incremental = '', + node_decremental = '', + }, }, - }, - move = { - enable = true, - set_jumps = true, -- whether to set jumps in the jumplist - goto_next_start = { - [']m'] = '@function.outer', - [']]'] = '@class.outer', + textobjects = { + select = { + enable = true, + lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim + keymaps = { + -- You can use the capture groups defined in textobjects.scm + ['aa'] = '@parameter.outer', + ['ia'] = '@parameter.inner', + ['af'] = '@function.outer', + ['if'] = '@function.inner', + ['ac'] = '@class.outer', + ['ic'] = '@class.inner', + }, + }, + move = { + enable = true, + set_jumps = true, -- whether to set jumps in the jumplist + goto_next_start = { + [']m'] = '@function.outer', + [']]'] = '@class.outer', + }, + goto_next_end = { + [']M'] = '@function.outer', + [']['] = '@class.outer', + }, + goto_previous_start = { + ['[m'] = '@function.outer', + ['[['] = '@class.outer', + }, + goto_previous_end = { + ['[M'] = '@function.outer', + ['[]'] = '@class.outer', + }, + }, + swap = { + enable = true, + swap_next = { + ['a'] = '@parameter.inner', + }, + swap_previous = { + ['A'] = '@parameter.inner', + }, + }, }, - goto_next_end = { - [']M'] = '@function.outer', - [']['] = '@class.outer', - }, - goto_previous_start = { - ['[m'] = '@function.outer', - ['[['] = '@class.outer', - }, - goto_previous_end = { - ['[M'] = '@function.outer', - ['[]'] = '@class.outer', - }, - }, - swap = { - enable = true, - swap_next = { - ['a'] = '@parameter.inner', - }, - swap_previous = { - ['A'] = '@parameter.inner', - }, - }, - }, - } + } end, 0) -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) - -- NOTE: Remember that lua is a real programming language, and as such it is possible - -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. - -- - -- In this case, we create a function that lets us more easily define mappings specific - -- for LSP related items. It sets the mode, buffer and description for us each time. - local nmap = function(keys, func, desc) - if desc then - desc = 'LSP: ' .. desc + -- NOTE: Remember that lua is a real programming language, and as such it is possible + -- to define small helper and utility functions so you don't have to repeat yourself + -- many times. + -- + -- In this case, we create a function that lets us more easily define mappings specific + -- for LSP related items. It sets the mode, buffer and description for us each time. + local nmap = function(keys, func, desc) + if desc then + desc = 'LSP: ' .. desc + end + + vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) end - vim.keymap.set('n', keys, func, { buffer = bufnr, desc = desc }) - end + nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') + nmap('ca', function() + vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } + end, '[C]ode [A]ction') - nmap('rn', vim.lsp.buf.rename, '[R]e[n]ame') - nmap('ca', function() - vim.lsp.buf.code_action { context = { only = { 'quickfix', 'refactor', 'source' } } } - end, '[C]ode [A]ction') + nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') + nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') + nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') + nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') + nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') + nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') - nmap('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition') - nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') - nmap('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation') - nmap('D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition') - nmap('ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols') - nmap('ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') + -- See `:help K` for why this keymap + nmap('K', vim.lsp.buf.hover, 'Hover Documentation') + nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') - -- See `:help K` for why this keymap - nmap('K', vim.lsp.buf.hover, 'Hover Documentation') - nmap('', vim.lsp.buf.signature_help, 'Signature Documentation') + -- Lesser used LSP functionality + nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') + nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') + nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') + nmap('wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, '[W]orkspace [L]ist Folders') - -- Lesser used LSP functionality - nmap('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration') - nmap('wa', vim.lsp.buf.add_workspace_folder, '[W]orkspace [A]dd Folder') - nmap('wr', vim.lsp.buf.remove_workspace_folder, '[W]orkspace [R]emove Folder') - nmap('wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, '[W]orkspace [L]ist Folders') - - -- Create a command `:Format` local to the LSP buffer - vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) - vim.lsp.buf.format() - end, { desc = 'Format current buffer with LSP' }) + -- Create a command `:Format` local to the LSP buffer + vim.api.nvim_buf_create_user_command(bufnr, 'Format', function(_) + vim.lsp.buf.format() + end, { desc = 'Format current buffer with LSP' }) end -- document existing key chains -require('which-key').register { - ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, - ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, - ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, - ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, - ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, - ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, - ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, - ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, -} --- register which-key VISUAL mode --- required for visual hs (hunk stage) to work -require('which-key').register({ - [''] = { name = 'VISUAL ' }, - ['h'] = { 'Git [H]unk' }, -}, { mode = 'v' }) +-- require('which-key').register { +-- ['c'] = { name = '[C]ode', _ = 'which_key_ignore' }, +-- ['d'] = { name = '[D]ocument', _ = 'which_key_ignore' }, +-- ['g'] = { name = '[G]it', _ = 'which_key_ignore' }, +-- ['h'] = { name = 'Git [H]unk', _ = 'which_key_ignore' }, +-- ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, +-- ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, +-- ['t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, +-- ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, +-- } +-- -- register which-key VISUAL mode +-- -- required for visual hs (hunk stage) to work +-- require('which-key').register({ +-- [''] = { name = 'VISUAL ' }, +-- ['h'] = { 'Git [H]unk' }, +-- }, { mode = 'v' }) -- mason-lspconfig requires that these setup functions are called in this order -- before setting up the servers. @@ -657,7 +705,6 @@ vim.api.nvim_create_autocmd("LspAttach", { -- toggle inlay hint vim.keymap.set("n", "ri", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end) - -- Enable the following language servers -- Feel free to add/remove any LSPs that you want here. They will automatically be installed. -- @@ -667,21 +714,41 @@ vim.keymap.set("n", "ri", function() vim.lsp.inlay_hint.enable(not vim.l -- If you want to override the default filetypes that your language server will attach to you can -- define the property 'filetypes' to the map in question. local servers = { - -- clangd = {}, - -- gopls = {}, - -- pyright = {}, - rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - - lua_ls = { - Lua = { - workspace = { checkThirdParty = false }, - telemetry = { enable = false }, - -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings - -- diagnostics = { disable = { 'missing-fields' } }, + -- clangd = {}, + -- gopls = {}, + -- pyright = {}, + rust_analyzer = { + imports = { + granularity = { + group = "module", + }, + prefix = "self", + }, + cargo = { + buildScripts = { + enable = true, + }, + }, + procMacro = { + enable = true, + }, + diagnostics = { + experimental = { + enable = false + } + } + }, + -- tsserver = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs'} }, + + lua_ls = { + Lua = { + workspace = { checkThirdParty = false }, + telemetry = { enable = false }, + -- NOTE: toggle below to ignore Lua_LS's noisy `missing-fields` warnings + -- diagnostics = { disable = { 'missing-fields' } }, + }, }, - }, } -- Setup neovim lua configuration @@ -695,18 +762,19 @@ capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) local mason_lspconfig = require 'mason-lspconfig' mason_lspconfig.setup { - ensure_installed = vim.tbl_keys(servers), + ensure_installed = vim.tbl_keys(servers), + -- ensure_installed = { "rust-analyzer" } } mason_lspconfig.setup_handlers { - function(server_name) - require('lspconfig')[server_name].setup { - capabilities = capabilities, - on_attach = on_attach, - settings = servers[server_name], - filetypes = (servers[server_name] or {}).filetypes, - } - end, + function(server_name) + require('lspconfig')[server_name].setup { + capabilities = capabilities, + on_attach = on_attach, + settings = servers[server_name], + filetypes = (servers[server_name] or {}).filetypes, + } + end, } -- [[ Configure nvim-cmp ]] @@ -717,46 +785,46 @@ require('luasnip.loaders.from_vscode').lazy_load() luasnip.config.setup {} cmp.setup { - snippet = { - expand = function(args) - luasnip.lsp_expand(args.body) - end, - }, - completion = { - completeopt = 'menu,menuone,noinsert', - }, - mapping = cmp.mapping.preset.insert { - [''] = cmp.mapping.select_next_item(), - [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.scroll_docs(-4), - [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete {}, - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, + completion = { + completeopt = 'menu,menuone,noinsert', + }, + mapping = cmp.mapping.preset.insert { + [''] = cmp.mapping.select_next_item(), + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.scroll_docs(-4), + [''] = cmp.mapping.scroll_docs(4), + [''] = cmp.mapping.complete {}, + [''] = cmp.mapping.confirm { + behavior = cmp.ConfirmBehavior.Replace, + select = true, + }, + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + elseif luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + else + fallback() + end + end, { 'i', 's' }), + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { 'i', 's' }), + }, + sources = { + { name = 'nvim_lsp' }, + { name = 'luasnip' }, + { name = 'path' }, }, - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - else - fallback() - end - end, { 'i', 's' }), - [''] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_prev_item() - elseif luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - else - fallback() - end - end, { 'i', 's' }), - }, - sources = { - { name = 'nvim_lsp' }, - { name = 'luasnip' }, - { name = 'path' }, - }, } diff --git a/.config/nvim/lazy-lock.json b/.config/nvim/lazy-lock.json index 5e299d2..77b9b3a 100644 --- a/.config/nvim/lazy-lock.json +++ b/.config/nvim/lazy-lock.json @@ -1,28 +1,28 @@ { - "Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" }, - "LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" }, + "Comment.nvim": { "branch": "master", "commit": "e30b7f2008e52442154b66f7c519bfd2f1e32acb" }, + "LuaSnip": { "branch": "master", "commit": "45db5addf8d0a201e1cf247cae4cdce605ad3768" }, + "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, - "fidget.nvim": { "branch": "main", "commit": "60404ba67044c6ab01894dd5bf77bd64ea5e09aa" }, - "friendly-snippets": { "branch": "main", "commit": "dcd4a586439a1c81357d5b9d26319ae218cc9479" }, - "harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" }, + "fidget.nvim": { "branch": "main", "commit": "d855eed8a06531a7e8fd0684889b2943f373c469" }, + "friendly-snippets": { "branch": "main", "commit": "00ebcaa159e817150bd83bfe2d51fa3b3377d5c4" }, + "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, "lazy.nvim": { "branch": "main", "commit": "077102c5bfc578693f12377846d427f49bc50076" }, - "mason-lspconfig.nvim": { "branch": "main", "commit": "21d33d69a81f6351e5a5f49078b2e4f0075c8e73" }, - "mason.nvim": { "branch": "main", "commit": "3b5068f0fc565f337d67a2d315d935f574848ee7" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "482350b050bd413931c2cdd4857443c3da7d57cb" }, + "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, "mini.files": { "branch": "main", "commit": "2e262838a773c0bc3ccbc9c4bcf4a1a012497ea2" }, - "neodev.nvim": { "branch": "main", "commit": "3157f2e876fd6223d36cfa76bee4709247d62fa5" }, - "nvim-autopairs": { "branch": "master", "commit": "c6139ca0d5ad7af129ea6c89cb4c56093f2c034a" }, - "nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" }, - "nvim-lspconfig": { "branch": "master", "commit": "ec7d51a619049c7c597f469f81ea199db6794651" }, - "nvim-treesitter": { "branch": "master", "commit": "fad40f2010c6f50aaad285b2752551a37d8772e4" }, - "nvim-treesitter-textobjects": { "branch": "master", "commit": "7f00d94543f1fd37cab2afa2e9a6cd54e1c6b9ef" }, - "onedark.nvim": { "branch": "master", "commit": "1230aaf2a427b2c5b73aba6e4a9a5881d3e69429" }, - "plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" }, + "neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" }, + "nvim-autopairs": { "branch": "master", "commit": "19606af7c039271d5aa96bceff101e7523af3136" }, + "nvim-cmp": { "branch": "main", "commit": "ae644feb7b67bf1ce4260c231d1d4300b19c6f30" }, + "nvim-lspconfig": { "branch": "master", "commit": "6bfd9210e312af6cfedba05d272e85618c93ab0d" }, + "nvim-treesitter": { "branch": "master", "commit": "585860a1865853d2c287c8ef534297da8115818e" }, + "nvim-treesitter-textobjects": { "branch": "master", "commit": "41e3abf6bfd9a9a681eb1f788bdeba91c9004b2b" }, + "onedark.nvim": { "branch": "master", "commit": "fae34f7c635797f4bf62fb00e7d0516efa8abe37" }, + "plenary.nvim": { "branch": "master", "commit": "ec289423a1693aeae6cd0d503bac2856af74edaa" }, "rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" }, - "telescope-fzf-native.nvim": { "branch": "main", "commit": "6c921ca12321edaa773e324ef64ea301a1d0da62" }, - "telescope.nvim": { "branch": "0.1.x", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, - "vim-fugitive": { "branch": "master", "commit": "2e88f14a585c014691904ba8fe39e6ea851c9422" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, + "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, + "vim-fugitive": { "branch": "master", "commit": "0444df68cd1cdabc7453d6bd84099458327e5513" }, "vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, - "which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" } + "which-key.nvim": { "branch": "main", "commit": "6c1584eb76b55629702716995cca4ae2798a9cca" } } diff --git a/.config/nvim/plugin/harpoon.lua b/.config/nvim/plugin/harpoon.lua index fcb2fdc..930ec8a 100644 --- a/.config/nvim/plugin/harpoon.lua +++ b/.config/nvim/plugin/harpoon.lua @@ -1,11 +1,11 @@ -local mark = require("harpoon.mark") -local ui = require("harpoon.ui") - -vim.keymap.set("n", "q", mark.add_file) -vim.keymap.set("n", "", ui.toggle_quick_menu) - -vim.keymap.set("n", "", function() ui.nav_file(1) end) -vim.keymap.set("n", "", function() ui.nav_file(2) end) -vim.keymap.set("n", "", function() ui.nav_file(3) end) -vim.keymap.set("n", "", function() ui.nav_file(4) end) -vim.keymap.set("n", "", function() ui.nav_file(5) end) +local harpoon = require("harpoon") +harpoon:setup() +-- +-- vim.keymap.set("n", "q", function() harpoon:list().append() end) +-- vim.keymap.set("n", "", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) +-- +-- vim.keymap.set("n", "", function() harpoon:list():select(1) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(2) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(3) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(4) end) +-- vim.keymap.set("n", "", function() harpoon:list():select(5) end) diff --git a/.config/nvim/plugin/minifiles.lua b/.config/nvim/plugin/minifiles.lua new file mode 100644 index 0000000..76ec814 --- /dev/null +++ b/.config/nvim/plugin/minifiles.lua @@ -0,0 +1,52 @@ +require('mini.files').setup({ + -- Customization of shown content + content = { + -- Predicate for which file system entries to show + filter = nil, + -- What prefix to show to the left of file system entry + prefix = nil, + -- In which order to show file system entries + sort = nil, + }, + + -- Module mappings created only inside explorer. + -- Use `''` (empty string) to not create one. + mappings = { + close = 'q', + go_in = 'l', + go_in_plus = 'L', + go_out = 'h', + go_out_plus = 'H', + reset = '', + reveal_cwd = '@', + show_help = 'g?', + synchronize = '=', + trim_left = '<', + trim_right = '>', + }, + + -- General options + options = { + -- Whether to delete permanently or move into module-specific trash + permanent_delete = true, + -- Whether to use for editing directories + use_as_default_explorer = true, + }, + + -- Customization of explorer windows + windows = { + -- Maximum number of windows to show side by side + max_number = math.huge, + -- Whether to show preview of file/directory under cursor + preview = false, + -- Width of focused window + width_focus = 50, + -- Width of non-focused window + width_nofocus = 15, + -- Width of preview window + width_preview = 25, + }, +}) + +vim.keymap.set("n", "-", 'lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()', { desc = 'Open MiniFiles' }) +vim.keymap.set("n", "", 'lua MiniFiles.close()', { desc = 'Close MiniFiles' }) diff --git a/.config/nvim/plugin/rustaceanvim.lua b/.config/nvim/plugin/rustaceanvim.lua new file mode 100644 index 0000000..c61053d --- /dev/null +++ b/.config/nvim/plugin/rustaceanvim.lua @@ -0,0 +1,50 @@ +-- vim.g.auto_ra_attach = true +-- +-- vim.g.rustaceanvim = { +-- -- Plugin configuration +-- tools = {}, +-- -- LSP configuration +-- ---@type RustaceanLspClientOpts +-- server = { +-- load_vscode_settings = true, +-- auto_attach = function(bufnr) +-- return vim.g.auto_ra_attach +-- end, +-- on_attach = function(client, _) +-- client.server_capabilities.workspace.didChangeWatchedFiles = { +-- dynamicRegistration = false, +-- relativePatternSupport = false, +-- } +-- +-- vim.api.nvim_create_autocmd({ 'BufEnter' }, { +-- desc = 'Resize splits when resizing the window', +-- pattern = { '*.rs' }, +-- callback = function() +-- vim.cmd('RustAnalyzer reloadSettings') +-- end, +-- }) +-- end, +-- default_settings = { +-- ['rust-analyzer'] = { +-- cachePriming = false, +-- rustfmt = { +-- extraArgs = { +-- '--config', +-- 'comment_width=120,condense_wildcard_suffixes=false,format_code_in_doc_comments=true,format_macro_bodies=true,hex_literal_case=Upper,imports_granularity=One,normalize_doc_attributes=true,wrap_comments=true', +-- }, +-- }, +-- }, +-- }, +-- }, +-- -- DAP configuration +-- dap = {}, +-- } +-- +-- return { +-- { +-- 'mrcjkb/rustaceanvim', +-- version = '^4', -- Recommended +-- ft = { 'rust' }, +-- dev = true, +-- }, +-- } diff --git a/.config/nvim/plugin/telescope.lua b/.config/nvim/plugin/telescope.lua index 81a0863..3edc053 100644 --- a/.config/nvim/plugin/telescope.lua +++ b/.config/nvim/plugin/telescope.lua @@ -1,3 +1,16 @@ +-- [[ Configure Telescope ]] +-- See `:help telescope` and `:help telescope.setup()` +require('telescope').setup { + defaults = { + mappings = { + i = { + [''] = false, + [''] = false, + }, + }, + }, +} + local builtin = require('telescope.builtin') vim.keymap.set('n', 'pf', builtin.find_files, {noremap = true})