├── init.lua ├── lua ├── plugins │ ├── comment.lua │ ├── vimbegood.lua │ ├── autopairs.lua │ ├── treesj.lua │ ├── surround.lua │ ├── gruvbox.lua │ ├── nvim-tree.lua │ ├── md.lua │ ├── toggleterm.lua │ ├── vimwiki.lua │ ├── colorizer.lua │ ├── telescope.lua │ ├── obsidian.lua │ ├── code-runner.lua │ ├── code-shot.lua │ ├── harpoon.lua │ ├── dashboard.lua │ ├── treesitter.lua │ ├── mason.lua │ ├── lualine.lua │ └── lsp.lua └── config │ ├── init.lua │ ├── netrw.lua │ ├── lazy.lua │ ├── autocmds.lua │ ├── options.lua │ └── mappings.lua ├── README.md └── lazy-lock.json /init.lua: -------------------------------------------------------------------------------- 1 | require("config") 2 | -------------------------------------------------------------------------------- /lua/plugins/comment.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'terrortylor/nvim-comment', 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/vimbegood.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'ThePrimeagen/vim-be-good' 3 | } 4 | -------------------------------------------------------------------------------- /lua/config/init.lua: -------------------------------------------------------------------------------- 1 | require('config.options') 2 | require('config.autocmds') 3 | require('config.lazy') 4 | require('config.mappings') 5 | require('config.netrw') 6 | -------------------------------------------------------------------------------- /lua/plugins/autopairs.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'windwp/nvim-autopairs', 3 | enabled = false, 4 | event = 'InsertEnter', 5 | config = true, 6 | opts = {} 7 | } 8 | -------------------------------------------------------------------------------- /lua/plugins/treesj.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'Wansmer/treesj', 3 | keys = { 'm' }, 4 | dependencies = { 'nvim-treesitter/nvim-treesitter' }, 5 | opts = {}, 6 | } 7 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # My Neovim configuration files 2 | 3 | I use Lazy plugin manager 4 | 5 | There are some configured plugins in the repo that I don't use. Look for "enabled" option. You can enable them if you'd like. 6 | -------------------------------------------------------------------------------- /lua/plugins/surround.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'kylechui/nvim-surround', 3 | version = '*', 4 | event = 'VeryLazy', 5 | opts = {} 6 | } 7 | 8 | -- ys (you) add suround 9 | -- ds delete surround 10 | -- cs change surround 11 | -------------------------------------------------------------------------------- /lua/plugins/gruvbox.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'sainnhe/gruvbox-material', 3 | priority = 1000, 4 | config = function() 5 | vim.g.gruvbox_material_enable_italic = true 6 | vim.cmd.colorscheme('gruvbox-material') 7 | end, 8 | } 9 | 10 | -------------------------------------------------------------------------------- /lua/plugins/nvim-tree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-tree/nvim-tree.lua', 3 | enabled = false, 4 | lazy = true, 5 | dependencies = { 6 | 'nvim-tree/nvim-web-devicons', 7 | }, 8 | opts = {}, 9 | keys = { 10 | { 'n', 'NvimTreeToggle', desc = 'Toggle Neotree'} 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /lua/plugins/md.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'MeanderingProgrammer/render-markdown.nvim', 3 | enabled = false, 4 | dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-tree/nvim-web-devicons' }, -- if you prefer nvim-web-devicons 5 | ---@module 'render-markdown' 6 | ---@type render.md.UserConfig 7 | opts = {}, 8 | } 9 | -------------------------------------------------------------------------------- /lua/config/netrw.lua: -------------------------------------------------------------------------------- 1 | -- hide the banner 2 | vim.g.netrw_banner = 0 3 | 4 | -- tree style listing 5 | vim.g.netrw_liststyle = 3 6 | 7 | -- options for netwr buffer 8 | vim.g.netrw_bufsettings = 'number relativenumber' 9 | 10 | vim.keymap.set('n', 'ex', 'Ex') 11 | vim.keymap.set('n', 've', 'Sex!') 12 | -------------------------------------------------------------------------------- /lua/plugins/toggleterm.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'akinsho/toggleterm.nvim', 3 | config = function () 4 | require('toggleterm').setup({ 5 | open_mapping = '', 6 | terminal_mappings = true, 7 | direction = 'float', 8 | float_opts = { 9 | border = 'curved', 10 | }, 11 | }) 12 | end 13 | } 14 | -------------------------------------------------------------------------------- /lua/plugins/vimwiki.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "vimwiki/vimwiki", 3 | enabled = false, 4 | event = "BufEnter *.md", 5 | keys = { "ww", "wt" }, 6 | init = function() 7 | -- vim.g.vimwiki_list = { 8 | -- { 9 | -- path = "~/vimwiki/", 10 | -- syntax = "markdown", 11 | -- ext = "md", 12 | -- }, 13 | -- } 14 | -- vim.g.vimwiki_ext2syntax = { } 15 | end, 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/colorizer.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'norcalli/nvim-colorizer.lua', 3 | -- config = function() 4 | -- require('colorizer').setup({ 5 | -- '*'; 6 | -- user_default_options = { 7 | -- names = false, 8 | -- mode = 'foreground' 9 | -- } 10 | -- }) 11 | -- end 12 | opts = { 13 | '*'; 14 | user_default_options = { 15 | names = false, 16 | RRGGBBAA = true, 17 | rgb_fn = true, 18 | hsl_fn = true, 19 | css = true, 20 | css_fn = true, 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lua/config/lazy.lua: -------------------------------------------------------------------------------- 1 | -- Bootstrap lazy.nvim 2 | local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' 3 | if not vim.loop.fs_stat(lazypath) then 4 | local lazyrepo = 'https://github.com/folke/lazy.nvim.git' 5 | vim.fn.system({ 6 | 'git', 7 | 'clone', 8 | '--filter=blob:none', 9 | '--branch=stable', 10 | lazyrepo, 11 | lazypath 12 | }) 13 | end 14 | vim.opt.rtp:prepend(lazypath) 15 | 16 | -- Setup lazy.nvim 17 | require('lazy').setup({ 18 | spec = { 19 | { import = 'plugins' } 20 | }, 21 | change_detection = { 22 | notify = false 23 | } 24 | }) 25 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-telescope/telescope.nvim', 3 | dependencies = { 4 | 'nvim-lua/plenary.nvim' 5 | }, 6 | 7 | config = function() 8 | local builtin = require('telescope.builtin') 9 | require('telescope').setup() 10 | 11 | vim.keymap.set('n', 'ff', builtin.find_files, { desc = 'find files' }) 12 | vim.keymap.set('n', 'fr', builtin.oldfiles, { desc = 'open recent files' }) 13 | vim.keymap.set('n', 'fg', builtin.git_files, { desc = 'find git files' }) 14 | vim.keymap.set('n', 'fc', builtin.commands, { desc = 'find commands' }) 15 | vim.keymap.set('n', 'fw', function() 16 | local word = vim.fn.expand('') 17 | builtin.grep_string({ search = word }) 18 | end, { desc = 'find word' }) 19 | 20 | vim.keymap.set('n', 'fh', builtin.help_tags, { desc = 'view help' }) 21 | end, 22 | } 23 | 24 | -------------------------------------------------------------------------------- /lua/plugins/obsidian.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "epwalsh/obsidian.nvim", 3 | version = "*", 4 | lazy = true, 5 | ft = "markdown", 6 | dependencies = { 7 | "nvim-lua/plenary.nvim", 8 | }, 9 | opts = { 10 | workspaces = { 11 | { 12 | name = "para", 13 | path = "~/para", 14 | }, 15 | }, 16 | 17 | ui = { 18 | checkboxes = { 19 | [" "] = { char = "󰄱", hl_group = "ObsidianTodo" }, 20 | ["x"] = { char = "", hl_group = "ObsidianDone" }, 21 | [">"] = { char = "", hl_group = "ObsidianRightArrow" }, 22 | ["~"] = { char = "󰰱", hl_group = "ObsidianTilde" }, 23 | ["!"] = { char = "", hl_group = "ObsidianImportant" }, 24 | -- Replace the above with this if you don't have a patched font: 25 | -- [" "] = { char = "☐", hl_group = "ObsidianTodo" }, 26 | -- ["x"] = { char = "✔", hl_group = "ObsidianDone" }, 27 | }, 28 | }, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /lua/plugins/code-runner.lua: -------------------------------------------------------------------------------- 1 | return { 'CRAG666/code_runner.nvim', 2 | config = function () 3 | require('code_runner').setup({ 4 | filetype = { 5 | python = "python -u", 6 | javascript = "node", 7 | }, 8 | }) 9 | 10 | vim.keymap.set('n', 'r', ':w | RunCode', { noremap = true, silent = false }) 11 | -- vim.keymap.set('n', 'rf', ':RunFile', { noremap = true, silent = false }) 12 | -- vim.keymap.set('n', 'rft', ':RunFile tab', { noremap = true, silent = false }) 13 | -- vim.keymap.set('n', 'rp', ':RunProject', { noremap = true, silent = false }) 14 | -- vim.keymap.set('n', 'rc', ':RunClose', { noremap = true, silent = false }) 15 | -- vim.keymap.set('n', 'crf', ':CRFiletype', { noremap = true, silent = false }) 16 | -- vim.keymap.set('n', 'crp', ':CRProjects', { noremap = true, silent = false }) 17 | end 18 | } 19 | -------------------------------------------------------------------------------- /lua/plugins/code-shot.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'niuiic/code-shot.nvim', 3 | dependencies = { 4 | 'niuiic/core.nvim', 5 | 'rcarriga/nvim-notify', 6 | }, 7 | 8 | config = function () 9 | local code_shot = require('code-shot') 10 | code_shot.setup({ 11 | ---@return string output file path 12 | output = function() 13 | local core = require("core") 14 | local buf_name = vim.api.nvim_buf_get_name(0) 15 | return core.file.name(buf_name) .. ".png" 16 | end, 17 | ---@return string[] 18 | -- select_area: {start_line: number, end_line: number} | nil 19 | options = function(select_area) 20 | if not select_area then 21 | return {} 22 | end 23 | return { 24 | "--line-offset", 25 | select_area.start_line, 26 | '--theme', 27 | 'Gruvbox' 28 | } 29 | end, 30 | }) 31 | 32 | vim.keymap.set('n', '', code_shot.shot) 33 | end 34 | } 35 | -------------------------------------------------------------------------------- /lua/plugins/harpoon.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'ThePrimeagen/harpoon', 3 | branch = 'harpoon2', 4 | dependencies = { 'nvim-lua/plenary.nvim' }, 5 | opts = { 6 | save_on_toggle = true, 7 | sync_on_ui_close = true 8 | }, 9 | config = function () 10 | local harpoon = require('harpoon') 11 | harpoon:setup() 12 | 13 | vim.keymap.set('n', 'a', function() harpoon:list():add() end) 14 | vim.keymap.set('n', '', function() harpoon.ui:toggle_quick_menu(harpoon:list()) end) 15 | vim.keymap.set('n', '', function() harpoon:list():prev() end) 16 | vim.keymap.set('n', '', function() harpoon:list():next() end) 17 | 18 | vim.keymap.set('n', '', function() harpoon:list():select(1) end) 19 | vim.keymap.set('n', '', function() harpoon:list():select(2) end) 20 | vim.keymap.set('n', '', function() harpoon:list():select(3) end) 21 | vim.keymap.set('n', '', function() harpoon:list():select(4) end) 22 | end, 23 | } 24 | -------------------------------------------------------------------------------- /lua/plugins/dashboard.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvimdev/dashboard-nvim', 3 | event = 'VimEnter', 4 | config = function() 5 | require('dashboard').setup { 6 | theme = 'hyper', 7 | config = { 8 | week_header = { 9 | enable = true, 10 | }, 11 | shortcut = { 12 | { 13 | desc = '󰊳 Update', 14 | group = '@property', 15 | action = 'Lazy update', 16 | key = 'u' 17 | }, 18 | { 19 | icon = ' ', 20 | icon_hl = '@variable', 21 | desc = 'Files', 22 | group = 'Label', 23 | action = 'Telescope find_files', 24 | key = 'f', 25 | }, 26 | { 27 | icon = ' ', 28 | desc = 'Config', 29 | action = 'edit ~/.config/nvim/init.lua', 30 | key = 'c' 31 | } 32 | }, 33 | }, 34 | } 35 | end, 36 | dependencies = { {'nvim-tree/nvim-web-devicons'}} 37 | } 38 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | 'nvim-treesitter/nvim-treesitter', 4 | enable = false, 5 | build = ':TSUpdate', 6 | lazy = false, 7 | keys = { 8 | { "", desc = "Increment Selection" }, 9 | { "", desc = "Decrement Selection", mode = "x" }, 10 | }, 11 | config = function() 12 | vim.filetype.add({ 13 | pattern = { [".*/hypr/.*%.conf"] = "hyprlang" } 14 | }) 15 | require('nvim-treesitter.configs').setup({ 16 | ensure_installed = { 17 | 'c', 18 | 'lua', 19 | 'vim', 20 | 'vimdoc', 21 | 'query', 22 | 'markdown', 23 | 'markdown_inline' 24 | }, 25 | 26 | auto_install = true, 27 | 28 | highlight = { 29 | enable = true, 30 | -- disable highlighting for large files 31 | disable = function(lang, buf) 32 | local max_filesize = 100 * 1024 -- 100 kb 33 | local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf)) 34 | if ok and stats and stats.size > max_filesize then 35 | return true 36 | end 37 | end, 38 | }, 39 | 40 | indent = { 41 | enable = true 42 | }, 43 | 44 | incremental_selection = { 45 | enable = true, 46 | keymaps = { 47 | init_selection = "", 48 | node_incremental = "", 49 | scope_incremental = false, 50 | node_decremental = "", 51 | }, 52 | }, 53 | }) 54 | end 55 | }, 56 | } 57 | -------------------------------------------------------------------------------- /lua/plugins/mason.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'williamboman/mason.nvim', 3 | enabled = false, 4 | config = function () 5 | -- Initialize the mason plugin, which manages installation of LSP servers and other tools 6 | 7 | local cmp_nvim_lsp = require('cmp_nvim_lsp') 8 | local capabilities = vim.tbl_deep_extend( 9 | 'force', -- Use 'force' to overwrite conflicting keys 10 | {}, -- Start with an empty table 11 | vim.lsp.protocol.make_client_capabilities(), -- Default LSP client capabilities 12 | cmp_nvim_lsp.default_capabilities() -- Capabilities required for nvim-cmp 13 | ) 14 | 15 | require('mason').setup() 16 | -- Initialize mason-lspconfig plugin, which bridges mason and nvim-lspconfig 17 | require('mason-lspconfig').setup({ 18 | handlers = { 19 | -- Handler function to set up each LSP server 20 | function(server_name) 21 | -- Set up the LSP server using nvim-lspconfig with the specified capabilities 22 | require('lspconfig')[server_name].setup({ 23 | capabilities = capabilities 24 | }) 25 | end, 26 | 27 | ['lua_ls'] = function () 28 | require('lspconfig').lua_ls.setup({ 29 | capabilities = capabilities, 30 | settings = { 31 | Lua = { 32 | diagnostics = { 33 | globals = { 'bit', 'vim', 'it', 'describe', 'before_each', 'after_each' }, 34 | } 35 | } 36 | } 37 | }) 38 | end 39 | } 40 | }) 41 | 42 | vim.keymap.set('n', '', 'Mason', { desc = 'Run Mason' }) 43 | end 44 | } 45 | -------------------------------------------------------------------------------- /lua/config/autocmds.lua: -------------------------------------------------------------------------------- 1 | -- Autosource for config files 2 | vim.api.nvim_create_autocmd('BufWritePost', { 3 | pattern = vim.fn.glob('~/.config/nvim/**/*.lua', true, true), 4 | command = 'source ' 5 | }) 6 | 7 | vim.api.nvim_create_autocmd("FileType", { 8 | pattern = "markdown", 9 | callback = function() 10 | vim.opt_local.wrap = true 11 | vim.keymap.set('n', 'k', 'gk', { desc = 'Go up one line even if it is wrapped' }) 12 | vim.keymap.set('n', 'j', 'gj', { desc = 'Go down one line even if it is wrapped' }) 13 | end, 14 | }) 15 | 16 | -- Trim trailing white spaces on save 17 | vim.api.nvim_create_autocmd('BufWritePre', { 18 | pattern = '*', 19 | callback = function() 20 | -- Save the cursor position 21 | local cursor_pos = vim.api.nvim_win_get_cursor(0) 22 | -- Remove trailing white spaces 23 | vim.cmd([[%s/\s\+$//e]]) 24 | -- Restore the cursor position 25 | vim.api.nvim_win_set_cursor(0, cursor_pos) 26 | end, 27 | }) 28 | 29 | -- Highlight yanked text 30 | vim.api.nvim_create_autocmd('TextYankPost', { 31 | callback = function() 32 | vim.highlight.on_yank() 33 | end 34 | }) 35 | 36 | -- Enable cursorline when entering a window 37 | vim.api.nvim_create_autocmd('WinEnter', { 38 | pattern = '*', 39 | callback = function() 40 | vim.wo.cursorline = true 41 | end, 42 | }) 43 | 44 | -- Disable cursorline when leaving a window 45 | vim.api.nvim_create_autocmd('WinLeave', { 46 | pattern = '*', 47 | callback = function() 48 | vim.wo.cursorline = false 49 | end, 50 | }) 51 | 52 | -- Help window is vertical 53 | vim.api.nvim_create_autocmd('BufWinEnter', { 54 | pattern = { '*.txt' }, 55 | callback = function() 56 | if vim.bo.filetype == 'help' then 57 | vim.cmd.wincmd('L') 58 | end 59 | end, 60 | }) 61 | -------------------------------------------------------------------------------- /lua/config/options.lua: -------------------------------------------------------------------------------- 1 | vim.g.mapleader = ' ' 2 | vim.g.maplocalleader = '\\' 3 | 4 | local options = { 5 | -- Clipboard settings 6 | clipboard = 'unnamedplus', -- Use system clipboard 7 | 8 | -- Line numbering 9 | number = true, -- Show line numbers 10 | relativenumber = true, -- Show relative line numbers 11 | 12 | -- Backup and swap files 13 | swapfile = false, -- Disable swap file 14 | backup = false, -- Disable backup file 15 | 16 | -- Text wrapping and scrolling 17 | wrap = false, -- Disable line wrapping 18 | smoothscroll = true, -- Enable smooth scrolling 19 | scrolloff = 8, -- Minimum number of screen lines to keep above and below the cursor 20 | 21 | -- Mouse and cursor settings 22 | mouse = '', -- Disable mouse support 23 | guicursor = '', -- Disable GUI cursor 24 | 25 | -- Splitting behavior 26 | splitright = true, -- Split vertical window to the right 27 | 28 | -- Indentation and tab settings 29 | expandtab = true, -- Use spaces instead of tabs 30 | cindent = true, -- Enable C-style indentation 31 | smarttab = true, -- Insert appropriate number of spaces on tab 32 | smartindent = true, -- Smart autoindenting on new lines 33 | shiftwidth = 2, -- Number of spaces to use for each step of (auto)indent 34 | tabstop = 2, -- Number of spaces that a in the file counts for 35 | 36 | -- Search settings 37 | hlsearch = false, -- Disable highlight on search 38 | incsearch = true, -- Show search matches as you type 39 | 40 | -- Visual settings 41 | termguicolors = true, -- Enable true color support 42 | -- colorcolumn = '130', -- Highlight column 130 43 | cursorline = true, -- Highlight the current line 44 | 45 | -- Performance settings 46 | updatetime = 50, -- Faster completion (default is 4000ms) 47 | 48 | -- For obsidian.nvim 49 | cole = 2, 50 | } 51 | 52 | for option, value in pairs(options) do 53 | vim.opt[option] = value 54 | end 55 | -------------------------------------------------------------------------------- /lua/plugins/lualine.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-lualine/lualine.nvim', 3 | enabled = true, 4 | dependencies = { 'nvim-tree/nvim-web-devicons' }, 5 | config = function() 6 | require('lualine').setup { 7 | options = { 8 | -- fmt = string.lower, 9 | icons_enabled = true, 10 | theme = 'gruvbox-material', 11 | component_separators = { left = '', right = ''}, 12 | section_separators = { left = '', right = ''}, 13 | -- Filetypes to disable lualine for. 14 | disabled_filetypes = { 15 | -- only ignores the ft for statusline. 16 | statusline = {}, 17 | -- only ignores the ft for winbar. 18 | winbar = {}, 19 | }, 20 | -- make statusline inactive for following data types 21 | ignore_focus = {}, 22 | -- a b c won't take the entire statusline 23 | always_divide_middle = true, 24 | -- if set to false every widnow will have its own statusnbar 25 | globalstatus = true, 26 | -- refresh time in ms 27 | refresh = { 28 | statusline = 1000, 29 | tabline = 1000, 30 | winbar = 1000, 31 | } 32 | }, 33 | sections = { 34 | lualine_a = { 35 | { 'mode', 36 | -- component specific options 37 | -- icons_enabled = true, -- Enables the display of icons alongside the component. 38 | -- icon = nil, 39 | -- custom separators for component 40 | -- separator = { left = '', right = ''} 41 | } 42 | }, 43 | lualine_b = { 'branch', 'diff', 'diagnostics' }, 44 | -- Date 45 | -- lualine_c = { "os.date('%a')", 'data', "require'lsp-status'.status()" }, 46 | lualine_c = { 47 | { 48 | -- 'buffers', 49 | 'filename', 50 | } 51 | }, 52 | lualine_x = { 'encoding', 'fileformat', 'filetype' }, 53 | lualine_y = { 'progress' }, 54 | lualine_z = { 'location' } 55 | }, 56 | -- I have no idea what it is needed for 57 | -- inactive_sections = { 58 | -- lualine_a = {}, 59 | -- lualine_b = {}, 60 | -- lualine_c = {'filename'}, 61 | -- lualine_x = {'location'}, 62 | -- lualine_y = {}, 63 | -- lualine_z = {} 64 | -- }, 65 | tabline = {}, 66 | winbar = {}, 67 | inactive_winbar = {}, 68 | extensions = {} 69 | } 70 | end 71 | } 72 | -------------------------------------------------------------------------------- /lua/config/mappings.lua: -------------------------------------------------------------------------------- 1 | local noarrows = true 2 | 3 | -- Leader keys 4 | vim.keymap.set('n', 'l', 'Lazy home', { desc = 'Open Lazy main menu' }) 5 | vim.keymap.set('n', 'd', '"_d', { desc = 'Delete to the void register' }) 6 | vim.keymap.set('n', 'y', '"*y', { desc = 'Yank to system clipboard' }) 7 | vim.keymap.set('n', 'Y', '"*Y', { desc = 'Yank line to system clipboard' }) 8 | vim.keymap.set('n', 's', [[:%s/\<\>//gI]], { desc = 'Substitute word under cursor' }) 9 | vim.keymap.set('n', 'o', 'okOj', { desc = 'Add empty lines' }) 10 | 11 | -- Buffer switching 12 | vim.keymap.set('n', 'gn', 'bnext', { desc = 'Next buffer' }) 13 | vim.keymap.set('n', 'gp', 'bprev', { desc = 'Previous buffer' }) 14 | vim.keymap.set('n', 'gd', 'bdelete', { desc = 'Delete buffer' }) 15 | 16 | -- Improved J 17 | vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Join line with next' }) 18 | 19 | -- Improved scrolling 20 | vim.keymap.set('n', '', 'zz', { desc = 'Scroll down and center' }) 21 | vim.keymap.set('n', '', 'zz', { desc = 'Scroll up and center' }) 22 | 23 | -- Improved next match 24 | vim.keymap.set('n', 'n', 'nzzzv', { desc = 'Next search result and center' }) 25 | vim.keymap.set('n', 'N', 'Nzzzv', { desc = 'Previous search result and center' }) 26 | 27 | -- Stuff for convenience 28 | vim.keymap.set('n', '', 'o', { desc = 'New line at end' }) 29 | vim.keymap.set('n', '', 'A,', { desc = 'Comma at end' }) 30 | vim.keymap.set('n', '==', 'gg=G', { desc = 'Reindent file' }) 31 | 32 | -- Window management remaps 33 | vim.keymap.set('n', '', '', { desc = 'Move to left window' }) 34 | vim.keymap.set('n', '', '', { desc = 'Move to below window' }) 35 | vim.keymap.set('n', '', '', { desc = 'Move to above window' }) 36 | vim.keymap.set('n', '', '', { desc = 'Move to right window' }) 37 | 38 | vim.keymap.set('n', '', 'vertical resize +6', { desc = 'Resize window left' }) 39 | vim.keymap.set('n', '', 'resize +3', { desc = 'Resize window down' }) 40 | vim.keymap.set('n', '', 'resize -3', { desc = 'Resize window up' }) 41 | vim.keymap.set('n', '', 'vertical resize -6', { desc = 'Resize window right' }) 42 | 43 | vim.keymap.set('v', 'J', ':m \'>+1gv=gv', { desc = 'Move line down' }) 44 | vim.keymap.set('v', 'K', ':m \'<-2gv=gv', { desc = 'Move line up' }) 45 | vim.keymap.set('v', 'y', '"*y', { desc = 'Yank to system clipboard' }) 46 | 47 | vim.keymap.set('i', 'jj', '', { desc = 'Escape insert mode' }) 48 | 49 | if noarrows == true then 50 | local skillissue = function() 51 | print("skill issue?") 52 | end 53 | 54 | vim.keymap.set('n', '', skillissue, { desc = 'No arrow keys'}) 55 | vim.keymap.set('n', '', skillissue, { desc = 'No arrow keys'}) 56 | vim.keymap.set('n', '', skillissue, { desc = 'No arrow keys'}) 57 | vim.keymap.set('n', '', skillissue, { desc = 'No arrow keys'}) 58 | end 59 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "2737edc9e674e537dc0a97e3405658d57d2d31ed" }, 3 | "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, 4 | "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, 5 | "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, 6 | "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, 7 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 8 | "code-shot.nvim": { "branch": "main", "commit": "246909d0f36fabcb66b137a3f41ec7789c869078" }, 9 | "code_runner.nvim": { "branch": "main", "commit": "00ab86fb87ac3be48a36dd7cafa0255d2e379965" }, 10 | "core.nvim": { "branch": "main", "commit": "26ada48758e73ff3763ac134a9a0da320a7762e4" }, 11 | "dashboard-nvim": { "branch": "master", "commit": "ae309606940d26d8c9df8b048a6e136b6bbec478" }, 12 | "fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" }, 13 | "gruvbox-material": { "branch": "master", "commit": "b16dcd787db5ba9302b54ebeac186784c2aed29a" }, 14 | "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, 15 | "lazy.nvim": { "branch": "main", "commit": "b1134ab82ee4279e31f7ddf7e34b2a99eb9b7bc9" }, 16 | "lspkind.nvim": { "branch": "master", "commit": "a700f1436d4a938b1a1a93c9962dc796afbaef4d" }, 17 | "lualine.nvim": { "branch": "master", "commit": "640260d7c2d98779cab89b1e7088ab14ea354a02" }, 18 | "mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" }, 19 | "mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" }, 20 | "nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" }, 21 | "nvim-cmp": { "branch": "main", "commit": "f17d9b4394027ff4442b298398dfcaab97e40c4f" }, 22 | "nvim-colorizer.lua": { "branch": "master", "commit": "a065833f35a3a7cc3ef137ac88b5381da2ba302e" }, 23 | "nvim-comment": { "branch": "main", "commit": "e9ac16ab056695cad6461173693069ec070d2b23" }, 24 | "nvim-lspconfig": { "branch": "master", "commit": "52302604e3c667cfdf33aadf89088e96eb3c5da3" }, 25 | "nvim-notify": { "branch": "master", "commit": "fbef5d32be8466dd76544a257d3f3dce20082a07" }, 26 | "nvim-surround": { "branch": "main", "commit": "ec2dc7671067e0086cdf29c2f5df2dd909d5f71f" }, 27 | "nvim-tree.lua": { "branch": "master", "commit": "610a1c189bdb2b9b936169b2ea9d1838f971fa2b" }, 28 | "nvim-treesitter": { "branch": "master", "commit": "c91122d2012682301df68307cfc049a57c3fd286" }, 29 | "nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" }, 30 | "obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" }, 31 | "plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" }, 32 | "render-markdown.nvim": { "branch": "main", "commit": "901838c63d644e27ed4b591fa5c5d587cad9e102" }, 33 | "telescope.nvim": { "branch": "master", "commit": "85922dde3767e01d42a08e750a773effbffaea3e" }, 34 | "toggleterm.nvim": { "branch": "main", "commit": "5969229c0352ff1ed7f6e24aba9c6554e1842939" }, 35 | "treesj": { "branch": "main", "commit": "0d81326b5afd36babe7dd480aabbb0b05f33e688" }, 36 | "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, 37 | "vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" } 38 | } 39 | -------------------------------------------------------------------------------- /lua/plugins/lsp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | -- Neovim built-in LSP configuration 3 | 'neovim/nvim-lspconfig', 4 | enabled = true, 5 | lazy = false, 6 | dependencies = { 7 | -- Mason LSPconfig: Extension to mason.nvim to automatically set up LSP servers 8 | 'williamboman/mason-lspconfig.nvim', 9 | 10 | -- Nvim-cmp: A completion engine plugin for Neovim written in Lua 11 | 'hrsh7th/nvim-cmp', 12 | 13 | -- nvim-cmp source for LSP 14 | 'hrsh7th/cmp-nvim-lsp', 15 | 16 | -- nvim-cmp source for buffer words 17 | 'hrsh7th/cmp-buffer', 18 | 19 | -- nvim-cmp source for filesystem paths 20 | 'hrsh7th/cmp-path', 21 | 22 | -- nvim-cmp source for Neovim's command-line 23 | 'hrsh7th/cmp-cmdline', 24 | 25 | -- LuaSnip: A snippet engine for Neovim written in Lua 26 | 'L3MON4D3/LuaSnip', 27 | 28 | -- nvim-cmp source for LuaSnip 29 | 'saadparwaiz1/cmp_luasnip', 30 | 31 | -- Fidget: Standalone UI for nvim-lsp progress. Eye candy for the impatient. 32 | 'j-hui/fidget.nvim', 33 | 34 | -- lspkind for awesome icons 35 | 'onsails/lspkind.nvim' 36 | }, 37 | 38 | config = function () 39 | require('fidget').setup({}) 40 | local cmp = require('cmp') 41 | local cmp_nvim_lsp = require('cmp_nvim_lsp') 42 | local lspkind = require('lspkind') 43 | local luasnip = require('luasnip') 44 | 45 | local lspconfig = require('lspconfig') 46 | 47 | local capabilities = vim.tbl_deep_extend( 48 | 'force', -- Use 'force' to overwrite conflicting keys 49 | {}, -- Start with an empty table 50 | vim.lsp.protocol.make_client_capabilities(), -- Default LSP client capabilities 51 | cmp_nvim_lsp.default_capabilities() -- Capabilities required for nvim-cmp 52 | ) 53 | 54 | lspconfig.lua_ls.setup({ 55 | cmd = { "lua-language-server" }, 56 | capabilities = capabilities, 57 | settings = { 58 | Lua = { 59 | diagnostics = { globals = { "vim" } }, 60 | telemetry = { enable = false }, 61 | }, 62 | }, 63 | }) 64 | 65 | lspconfig.nixd.setup({ 66 | cmd = { "nixd" }, 67 | capabilities = capabilities, 68 | }) 69 | 70 | lspconfig.pylsp.setup({ 71 | capabilities = capabilities, 72 | settings = { 73 | pylsp = { 74 | plugins = { 75 | pycodestyle = { 76 | ignore = {'W391'}, 77 | maxLineLength = 100 78 | } 79 | } 80 | } 81 | } 82 | }) 83 | 84 | -- Setup completion configuration for nvim-cmp 85 | cmp.setup({ 86 | snippet = { 87 | expand = function (args) 88 | luasnip.lsp_expand(args.body) 89 | end 90 | }, 91 | 92 | mapping = cmp.mapping.preset.insert({ 93 | -- Mapping for triggering completion 94 | [''] = cmp.mapping.complete(), 95 | -- Mapping for scrolling documentation upwards 96 | [''] = cmp.mapping.scroll_docs(-4), 97 | -- Mapping for scrolling documentation downwards 98 | [''] = cmp.mapping.scroll_docs(4), 99 | -- Mapping for closing completion window 100 | [''] = cmp.mapping.close(), 101 | -- Mapping for confirming selection with Enter key 102 | -- [''] = cmp.mapping.confirm { 103 | -- behavior = cmp.ConfirmBehavior.Replace, 104 | -- select = true, 105 | -- }, 106 | -- Mapping for selecting next item in completion menu with Tab 107 | [''] = cmp.mapping(function(fallback) 108 | if cmp.visible() then 109 | cmp.select_next_item() 110 | elseif luasnip.expand_or_jumpable() then 111 | luasnip.expand_or_jump() 112 | else 113 | fallback() 114 | end 115 | end, { 'i', 's' }), 116 | -- Mapping for selecting previous item in completion menu with Shift+Tab 117 | [''] = cmp.mapping(function(fallback) 118 | if cmp.visible() then 119 | cmp.select_prev_item() 120 | elseif luasnip.jumpable(-1) then 121 | luasnip.jump(-1) 122 | else 123 | fallback() 124 | end 125 | end, { 'i', 's' }), 126 | }), 127 | 128 | sources = cmp.config.sources({ 129 | -- Set source for LSP 130 | { name = 'nvim_lsp' }, 131 | -- Set source for file paths 132 | { name = 'path' }, 133 | -- Set source for LuaSnip snippets 134 | { name = 'luasnip' } 135 | }, { 136 | -- If cmp haven't found anything in the first table, it goes to this one 137 | { name = 'buffer' }, 138 | }), 139 | 140 | formatting = { 141 | format = lspkind.cmp_format({ 142 | mode = 'symbol_text', 143 | maxwidth = 50, 144 | ellipsis_char = '...', 145 | show_labelDetails = true, 146 | }) 147 | }, 148 | 149 | experimental = { 150 | ghost_text = true 151 | } 152 | }) 153 | 154 | -- Setup completion configuration for search command-line mode 155 | cmp.setup.cmdline({ '?', '/' }, { 156 | mapping = cmp.mapping.preset.cmdline(), 157 | sources = { 158 | -- Set source for buffer words 159 | { name = 'buffer' } 160 | } 161 | }) 162 | 163 | -- Setup completion configuration for command-line mode 164 | cmp.setup.cmdline(':', { 165 | mapping = cmp.mapping.preset.cmdline(), 166 | sources = cmp.config.sources({ 167 | -- Set source for file paths 168 | { name = 'path' } 169 | }, { 170 | -- Set source for command-line commands 171 | { name = 'cmdline' } 172 | }), 173 | -- Allow non-prefix matching for symbols 174 | matching = { disallow_symbol_nonprefix_matching = false } 175 | }) 176 | 177 | -- Create a capabilities table by deeply merging several tables 178 | -- This ensures that the LSP client capabilities are extended with nvim-cmp capabilities 179 | 180 | 181 | vim.keymap.set('n', 'gd', function() vim.lsp.buf.definition() end, { desc = "Go to definition" }) 182 | vim.keymap.set('n', 'K', function() vim.lsp.buf.hover() end, { desc = "Hover" }) 183 | vim.keymap.set('n', 'vws', function() vim.lsp.buf.workspace_symbol() end, { desc = "Workspace symbol" }) 184 | vim.keymap.set('n', 'vd', function() vim.diagnostic.open_float() end, { desc = "Open diagnostic float" }) 185 | vim.keymap.set('n', 'vca', function() vim.lsp.buf.code_action() end, { desc = "Code action" }) 186 | vim.keymap.set('n', 'vrr', function() vim.lsp.buf.references() end, { desc = "References" }) 187 | vim.keymap.set('n', 'vrn', function() vim.lsp.buf.rename() end, { desc = "Rename" }) 188 | vim.keymap.set('n', '[d', function() vim.diagnostic.goto_next() end, { desc = "Next diagnostic" }) 189 | vim.keymap.set('n', ']d', function() vim.diagnostic.goto_prev() end, { desc = "Previous diagnostic" }) 190 | vim.keymap.set('i', '', function() vim.lsp.buf.signature_help() end, { desc = "Signature help" }) 191 | end 192 | } 193 | --------------------------------------------------------------------------------