├── .gitignore ├── lua ├── plugins │ ├── ag.lua │ ├── helm.lua │ ├── colorscheme.lua │ ├── which-key.lua │ ├── docker.lua │ ├── markdown.lua │ ├── copilot.lua │ ├── gopher.lua │ ├── ui.lua │ ├── editor.lua │ ├── tmux-navigator.lua │ ├── neotree.lua │ ├── telescope.lua │ ├── treesitter.lua │ ├── git.lua │ ├── cmp.lua │ └── lspconfig.lua └── core │ ├── filetype.lua │ ├── init.lua │ ├── keymaps.lua │ └── options.lua ├── init.lua ├── README.md └── lazy-lock.json /.gitignore: -------------------------------------------------------------------------------- 1 | .netrwhist 2 | autoload/ 3 | plugged/ 4 | -------------------------------------------------------------------------------- /lua/plugins/ag.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "rking/ag.vim", 3 | } 4 | -------------------------------------------------------------------------------- /lua/plugins/helm.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'towolf/vim-helm', 3 | ft = "helm", 4 | } 5 | -------------------------------------------------------------------------------- /init.lua: -------------------------------------------------------------------------------- 1 | require('core.init') 2 | require('core.options') 3 | require('core.filetype') 4 | require('core.keymaps') 5 | -------------------------------------------------------------------------------- /lua/plugins/colorscheme.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "catppuccin/nvim", 3 | name = "catppuccin", 4 | lazy = false, 5 | priority = 1000 6 | } 7 | -------------------------------------------------------------------------------- /lua/plugins/which-key.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "folke/which-key.nvim", 3 | event = "VeryLazy", 4 | init = function() 5 | vim.o.timeout = true 6 | vim.o.timeoutlen = 300 7 | end, 8 | opts = { 9 | 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## How to installl 2 | 3 | ### Requirements 4 | - neovim >= 0.9 5 | - lazyygit 6 | - lazydocker 7 | - fd-find 8 | - ripgrep 9 | 10 | To Install this config, just clone to neovim directory 11 | ``` 12 | git clone git@github.com:ata/nvim-config.git ~/.config/nvim 13 | ``` 14 | -------------------------------------------------------------------------------- /lua/plugins/docker.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "crnvl96/lazydocker.nvim", 3 | event = "VeryLazy", 4 | dependencies = { 5 | "MunifTanjim/nui.nvim", 6 | }, 7 | opts = {}, 8 | keys = { 9 | { "ld", ":LazyDocker", desc = "Open LazyDocker" }, 10 | }, 11 | } 12 | -------------------------------------------------------------------------------- /lua/core/filetype.lua: -------------------------------------------------------------------------------- 1 | vim.filetype.add({ 2 | extension = { 3 | -- foo = 'fooscript' 4 | }, 5 | filename = { 6 | -- ['.foorc'] = 'toml', 7 | }, 8 | pattern = { 9 | ['docker-.*.ya?ml'] = 'yaml.docker-compose', 10 | ['Dockerfile(.*)?'] = 'dockerfile', 11 | ['templates/.*.yaml'] = 'helm', 12 | }, 13 | }) 14 | -------------------------------------------------------------------------------- /lua/plugins/markdown.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "iamcco/markdown-preview.nvim", 3 | cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, 4 | ft = { "markdown" }, 5 | keys = { 6 | { "mp", ":MarkdownPreview", desc = "Open MarkdownPreview" } 7 | }, 8 | build = function() 9 | vim.fn["mkdp#util#install"]() 10 | end, 11 | } 12 | -------------------------------------------------------------------------------- /lua/plugins/copilot.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "zbirenbaum/copilot.lua", 4 | cmd = "Copilot", 5 | event = "InsertEnter", 6 | config = function() 7 | require("copilot").setup({}) 8 | end, 9 | }, 10 | { 11 | "zbirenbaum/copilot-cmp", 12 | config = function() 13 | require("copilot_cmp").setup() 14 | end 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/gopher.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "olexsmir/gopher.nvim", 3 | ft = "go", 4 | dependencies = { 5 | "nvim-lua/plenary.nvim", 6 | "nvim-treesitter/nvim-treesitter", 7 | "mfussenegger/nvim-dap", -- (optional) only if you use `gopher.dap` 8 | }, 9 | -- (optional) will update plugin's deps on every update 10 | -- build = function() 11 | -- vim.cmd.GoInstallDeps() 12 | -- end, 13 | opts = {}, 14 | } 15 | -------------------------------------------------------------------------------- /lua/plugins/ui.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "nvim-lualine/lualine.nvim", 4 | dependencies = { 'nvim-tree/nvim-web-devicons' }, 5 | lazy = false, 6 | config = function() 7 | require('lualine').setup { 8 | sections = { 9 | lualine_c = { 10 | { 11 | 'filename', 12 | path = 1, 13 | } 14 | } 15 | } 16 | } 17 | end 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /lua/core/init.lua: -------------------------------------------------------------------------------- 1 | local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" 2 | if not vim.loop.fs_stat(lazypath) then 3 | vim.fn.system({ 4 | "git", 5 | "clone", 6 | "--filter=blob:none", 7 | "https://github.com/folke/lazy.nvim.git", 8 | "--branch=stable", -- latest stable release 9 | lazypath, 10 | }) 11 | end 12 | 13 | vim.opt.rtp:prepend(lazypath) 14 | 15 | require("lazy").setup("plugins", { 16 | checker = { enabled = true, notify = false }, 17 | change_detection = { notify = false, }, 18 | }) 19 | -------------------------------------------------------------------------------- /lua/plugins/editor.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "godlygeek/tabular", 3 | "mg979/vim-visual-multi", 4 | { 5 | "echasnovski/mini.comment", 6 | event = "VeryLazy", 7 | opts = { 8 | options = { 9 | custom_commentstring = function() 10 | return vim.bo.commentstring 11 | end, 12 | }, 13 | }, 14 | }, 15 | { 16 | "ntpeters/vim-better-whitespace", 17 | }, 18 | { 19 | "lukas-reineke/indent-blankline.nvim", 20 | main = "ibl", 21 | opts = {}, 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /lua/plugins/tmux-navigator.lua: -------------------------------------------------------------------------------- 1 | -- Others 2 | return { 3 | "christoomey/vim-tmux-navigator", 4 | cmd = { 5 | "TmuxNavigateLeft", 6 | "TmuxNavigateDown", 7 | "TmuxNavigateUp", 8 | "TmuxNavigateRight", 9 | "TmuxNavigatePrevious", 10 | }, 11 | keys = { 12 | { "", "TmuxNavigateLeft" }, 13 | { "", "TmuxNavigateDown" }, 14 | { "", "TmuxNavigateUp" }, 15 | { "", "TmuxNavigateRight" }, 16 | { "", "TmuxNavigatePrevious" }, 17 | }, 18 | } 19 | 20 | -------------------------------------------------------------------------------- /lua/plugins/neotree.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-neo-tree/neo-tree.nvim", 3 | branch = "v3.x", 4 | dependencies = { 5 | "nvim-lua/plenary.nvim", 6 | "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended 7 | "MunifTanjim/nui.nvim", 8 | -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information 9 | }, 10 | config = function() 11 | require("neo-tree").setup {} 12 | local map = vim.keymap.set 13 | map('n', 'ee', ":Neotree", { desc = "Find file in exporer" }) 14 | map('n', 'ef', ":Neotree reveal", { desc = "Find file in exporer" }) 15 | end 16 | } 17 | -------------------------------------------------------------------------------- /lua/plugins/telescope.lua: -------------------------------------------------------------------------------- 1 | return { 2 | 'nvim-telescope/telescope.nvim', tag = '0.1.5', 3 | dependencies = { 4 | 'nvim-lua/plenary.nvim', 5 | { 6 | 'nvim-telescope/telescope-fzf-native.nvim', 7 | build = 'make' 8 | }, 9 | }, 10 | config = function() 11 | require("telescope").setup { 12 | extensions = { 13 | fzf = { 14 | fuzzy = true, -- false will only do exact matching 15 | override_generic_sorter = true, -- override the generic sorter 16 | override_file_sorter = true, -- override the file sorter 17 | case_mode = "smart_case", -- or "ignore_case" or "respect_case" 18 | -- the default case_mode is "smart_case" 19 | } 20 | } 21 | } 22 | require('telescope').load_extension('fzf') 23 | 24 | -- Set keymap 25 | local builtin = require('telescope.builtin') 26 | local map = vim.keymap.set 27 | map('n', 'ff', builtin.find_files, { desc = "Find files" }) 28 | map('n', 'fg', builtin.live_grep, { desc="Live Grep" }) 29 | map('n', 'fb', builtin.buffers, { desc= "Find in buffers" }) 30 | map('n', 'fh', builtin.help_tags, { desc ="Help tags" }) 31 | 32 | end 33 | } 34 | -------------------------------------------------------------------------------- /lua/core/keymaps.lua: -------------------------------------------------------------------------------- 1 | local map = vim.keymap.set 2 | 3 | -- Mapping the jumping between splits. Hold control while using vim nav. 4 | map("n", "", "j") 5 | map("n", "", "k") 6 | map("n", "", "h") 7 | map("n", "", "l") 8 | 9 | -- Tab Navigation 10 | map("n", "l", ":tablast", { desc = "Last Tab" }) 11 | map("n", "f", ":tabfirst", { desc = "First Tab" }) 12 | map("n", "", ":tabnew", { desc = "New Tab" }) 13 | map("n", "]", ":tabnext", { desc = "Next Tab" }) 14 | map("n", "d", ":tabclose", { desc = "Close Tab" }) 15 | map("n", "[", ":tabprevious", { desc = "Previous Tab" }) 16 | 17 | -- buffer resizing mappings (shift + arrow key) 18 | map("n", "", "-") 19 | map("n", "", "+") 20 | map("n", "", "<<<") 21 | map("n", "", ">>>") 22 | 23 | -- Quiting 24 | map("n", "qq", ":qa!", { desc="Quit All" }) 25 | map("n", "qa", ":qa!", { desc="Quit All" }) 26 | map("n", "qw", ":wqall", { desc="Quit All And Save" }) 27 | 28 | -- Editing 29 | map("n", "w", ":set wrap!", { desc = "Wrap Line"}) 30 | map("n", "Y","y$", { desc="Yank from the cursor to the end of the line" }) 31 | map("n", "vv","`[V`]", { desc="select the lines which were just pasted" }) 32 | -- map("n", "e", ":s/\\v(\\S+)\\s+/\\1 /:nohl", { desc="compress excess whitespace on current line" }) 33 | map("n", "d", ":bufdo bd", { desc="delete all buffers" }) 34 | map("n", "", ":StripWhitespace", { desc="clean up trailing whitespace" }) 35 | map("n", "c", ":noh", { desc="spacebar to clear search highlight" }) 36 | map("n", "I", "gg=G``", { desc="reindent the entire file" }) 37 | -------------------------------------------------------------------------------- /lua/plugins/treesitter.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "nvim-treesitter/nvim-treesitter", 3 | event = { "BufReadPre", "BufNewFile" }, 4 | build = ":TSUpdate", 5 | dependencies = { 6 | "nvim-treesitter/nvim-treesitter-textobjects", 7 | "windwp/nvim-ts-autotag", 8 | "JoosepAlviste/nvim-ts-context-commentstring", 9 | }, 10 | config = function() 11 | -- import nvim-treesitter plugin 12 | local treesitter = require("nvim-treesitter.configs") 13 | 14 | -- configure treesitter 15 | treesitter.setup({ -- enable syntax highlighting 16 | highlight = { 17 | enable = true, 18 | disable = { "dockerfile" } 19 | }, 20 | -- enable indentation 21 | indent = { enable = true }, 22 | -- enable autotagging (w/ nvim-ts-autotag plugin) 23 | autotag = { 24 | enable = true, 25 | }, 26 | -- ensure these language parsers are installed 27 | ensure_installed = { 28 | "json", 29 | "javascript", 30 | "typescript", 31 | "tsx", 32 | "yaml", 33 | "html", 34 | "css", 35 | "prisma", 36 | "markdown", 37 | "markdown_inline", 38 | "svelte", 39 | "graphql", 40 | "bash", 41 | "lua", 42 | "vim", 43 | "dockerfile", 44 | "gitignore", 45 | "query", 46 | "go", 47 | }, 48 | incremental_selection = { 49 | enable = true, 50 | keymaps = { 51 | init_selection = "", 52 | node_incremental = "", 53 | scope_incremental = false, 54 | node_decremental = "", 55 | }, 56 | }, 57 | }) 58 | 59 | -- enable nvim-ts-context-commentstring plugin for commenting tsx and jsx 60 | require('ts_context_commentstring').setup {} 61 | end, 62 | } 63 | -------------------------------------------------------------------------------- /lua/plugins/git.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "lewis6991/gitsigns.nvim", 4 | config = function() 5 | local gs = require('gitsigns') 6 | local function map(mode, l, r, opts) 7 | opts = opts or {} 8 | opts.buffer = bufnr 9 | vim.keymap.set(mode, l, r, opts) 10 | end 11 | 12 | gs.setup() 13 | 14 | -- Navigation 15 | map('n', ']c', function() 16 | if vim.wo.diff then return ']c' end 17 | vim.schedule(function() gs.next_hunk() end) 18 | return '' 19 | end, { expr = true }) 20 | 21 | map('n', '[c', function() 22 | if vim.wo.diff then return '[c' end 23 | vim.schedule(function() gs.prev_hunk() end) 24 | return '' 25 | end, { expr = true }) 26 | 27 | -- Actions 28 | map('n', 'gs', gs.stage_hunk, { desc = "Git: Stage the hunk at the cursor position" }) 29 | map('n', 'gr', gs.reset_hunk, { desc = "Git: Reset the lines of the hunk at the cursor position" }) 30 | map('v', 'gs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end, 31 | { desc = "Git: Stage the hunk at the cursor position on visual mode" }) 32 | map('v', 'gr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end, 33 | { desc = "Git: Reset the lines of the hunk at the cursor position on visual mode" }) 34 | map('n', 'gS', gs.stage_buffer, { desc = "Git: Stage all hunks in current buffer" }) 35 | map('n', 'gu', gs.undo_stage_hunk, { desc = "Git: Undo the last call of stage_hunk" }) 36 | map('n', 'gR', gs.reset_buffer, { desc = "Git: Reset the lines of all hunks in the buffer" }) 37 | map('n', 'gp', gs.preview_hunk, 38 | { desc = "Git: Preview the hunk at the cursor position in a floating window" }) 39 | map('n', 'gb', function() gs.blame_line { full = true } end, { desc = "Git: Blame line" }) 40 | map('n', 'gtb', gs.toggle_current_line_blame, { desc = "Git: Toggle curret line blame" }) 41 | map('n', 'gtd', gs.toggle_deleted, { desc = "Git: Toggle delete" }) 42 | 43 | map('n', 'gd', gs.diffthis, { desc = "Git: Diff This" }) 44 | map('n', 'gD', function() gs.diffthis('~') end, { desc = "Git: Diff This" }) 45 | 46 | -- Text object 47 | map({ 'o', 'x' }, 'ih', ':Gitsigns select_hunk') 48 | end 49 | }, 50 | { 51 | "kdheepak/lazygit.nvim", 52 | dependencies = { 53 | "nvim-lua/plenary.nvim", 54 | }, 55 | keys = { 56 | { 'lg', ':LazyGit', desc = "Open LazyGit" } 57 | }, 58 | }, 59 | } 60 | -------------------------------------------------------------------------------- /lua/plugins/cmp.lua: -------------------------------------------------------------------------------- 1 | return { 2 | "hrsh7th/nvim-cmp", 3 | event = "InsertEnter", 4 | dependencies = { 5 | "hrsh7th/cmp-buffer", -- source for text in buffer 6 | "hrsh7th/cmp-path", -- source for file system paths 7 | "hrsh7th/cmp-nvim-lsp", -- source for file system paths 8 | "L3MON4D3/LuaSnip", -- snippet engine 9 | "saadparwaiz1/cmp_luasnip", -- for autocompletion 10 | "rafamadriz/friendly-snippets", -- useful snippets 11 | "onsails/lspkind.nvim", -- vs-code like pictograms 12 | }, 13 | config = function() 14 | local has_words_before = function() 15 | unpack = unpack or table.unpack 16 | local line, col = unpack(vim.api.nvim_win_get_cursor(0)) 17 | return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil 18 | end 19 | local cmp = require("cmp") 20 | local luasnip = require("luasnip") 21 | local lspkind = require("lspkind") 22 | 23 | -- loads vscode style snippets from installed plugins (e.g. friendly-snippets) 24 | require("luasnip.loaders.from_vscode").lazy_load() 25 | 26 | cmp.setup({ 27 | completion = { 28 | completeopt = "menu,menuone,preview,noselect", 29 | }, 30 | snippet = { -- configure how nvim-cmp interacts with snippet engine 31 | expand = function(args) 32 | luasnip.lsp_expand(args.body) 33 | end, 34 | }, 35 | mapping = cmp.mapping.preset.insert({ 36 | [""] = cmp.mapping.select_prev_item(), -- previous suggestion 37 | [""] = cmp.mapping.select_next_item(), -- next suggestion 38 | [""] = cmp.mapping.scroll_docs(-4), 39 | [""] = cmp.mapping.scroll_docs(4), 40 | [""] = cmp.mapping.complete(), -- show completion suggestions 41 | [""] = cmp.mapping.abort(), -- close completion window 42 | [""] = cmp.mapping.confirm({ select = false }), 43 | [""] = cmp.mapping(function(fallback) 44 | if cmp.visible() then 45 | cmp.select_next_item() 46 | -- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable() 47 | -- that way you will only jump inside the snippet region 48 | elseif luasnip.expand_or_jumpable() then 49 | luasnip.expand_or_jump() 50 | elseif has_words_before() then 51 | cmp.complete() 52 | else 53 | fallback() 54 | end 55 | end, { "i", "s" }), 56 | 57 | [""] = cmp.mapping(function(fallback) 58 | if cmp.visible() then 59 | cmp.select_prev_item() 60 | elseif luasnip.jumpable(-1) then 61 | luasnip.jump(-1) 62 | else 63 | fallback() 64 | end 65 | end, { "i", "s" }), 66 | 67 | }), 68 | -- sources for autocompletion 69 | sources = cmp.config.sources({ 70 | { name = "copilot" }, 71 | { name = "nvim_lsp" }, 72 | { name = "luasnip" }, -- snippets 73 | { name = "buffer" }, -- text within current buffer 74 | { name = "path" }, -- file system paths 75 | }), 76 | -- configure lspkind for vs-code like pictograms in completion menu 77 | formatting = { 78 | format = lspkind.cmp_format({ 79 | mode = "symbol", 80 | maxwidth = 50, 81 | ellipsis_char = "...", 82 | symbol_map = { Copilot = "" } 83 | }), 84 | }, 85 | }) 86 | end, 87 | } 88 | -------------------------------------------------------------------------------- /lazy-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "LuaSnip": { "branch": "master", "commit": "fb525166ccc30296fb3457441eb979113de46b00" }, 3 | "ag.vim": { "branch": "master", "commit": "4a0dd6e190f446e5a016b44fdaa2feafc582918e" }, 4 | "catppuccin": { "branch": "main", "commit": "fa42eb5e26819ef58884257d5ae95dd0552b9a66" }, 5 | "claude-code.nvim": { "branch": "main", "commit": "275c47615f4424a0329290ce1d0c18a8320fd8b0" }, 6 | "cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" }, 7 | "cmp-nvim-lsp": { "branch": "main", "commit": "a8912b88ce488f411177fc8aed358b04dc246d7b" }, 8 | "cmp-path": { "branch": "main", "commit": "c6635aae33a50d6010bf1aa756ac2398a2d54c32" }, 9 | "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, 10 | "copilot-cmp": { "branch": "master", "commit": "15fc12af3d0109fa76b60b5cffa1373697e261d1" }, 11 | "copilot.lua": { "branch": "master", "commit": "c1bb86abbed1a52a11ab3944ef00c8410520543d" }, 12 | "friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" }, 13 | "gitsigns.nvim": { "branch": "main", "commit": "1b0350ab707713b2bc6c236151f1a324175347b1" }, 14 | "gopher.nvim": { "branch": "main", "commit": "de585144ebde9f0516fb9b542dd42e90c7835b59" }, 15 | "indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" }, 16 | "lazy.nvim": { "branch": "main", "commit": "6c3bda4aca61a13a9c63f1c1d1b16b9d3be90d7a" }, 17 | "lazydocker.nvim": { "branch": "main", "commit": "d5878defd757a193fbd73f12ec54faee9a6b19e1" }, 18 | "lazygit.nvim": { "branch": "main", "commit": "4839ab642962cc76bb1bf278427dc4c59be15072" }, 19 | "lspkind.nvim": { "branch": "master", "commit": "d79a1c3299ad0ef94e255d045bed9fa26025dab6" }, 20 | "lualine.nvim": { "branch": "master", "commit": "a94fc68960665e54408fe37dcf573193c4ce82c9" }, 21 | "markdown-preview.nvim": { "branch": "master", "commit": "a923f5fc5ba36a3b17e289dc35dc17f66d0548ee" }, 22 | "mason-lspconfig.nvim": { "branch": "main", "commit": "c4c84f4521d62de595c0d0f718a9a40c1890c8ce" }, 23 | "mason.nvim": { "branch": "main", "commit": "8024d64e1330b86044fed4c8494ef3dcd483a67c" }, 24 | "mini.comment": { "branch": "main", "commit": "51c173dffa17dc14c81169deaeea430bd394ab51" }, 25 | "neo-tree.nvim": { "branch": "v3.x", "commit": "f481de16a0eb59c985abac8985e3f2e2f75b4875" }, 26 | "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, 27 | "nvim-cmp": { "branch": "main", "commit": "b5311ab3ed9c846b585c0c15b7559be131ec4be9" }, 28 | "nvim-dap": { "branch": "master", "commit": "2edd6375692d9ac1053d50acfe415c1eb2ba92d0" }, 29 | "nvim-lsp-file-operations": { "branch": "master", "commit": "9744b738183a5adca0f916527922078a965515ed" }, 30 | "nvim-lspconfig": { "branch": "master", "commit": "5e0e9c00d51fcb7efef0d4c49023f9593b38661e" }, 31 | "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, 32 | "nvim-treesitter-textobjects": { "branch": "master", "commit": "89ebe73cd2836db80a22d9748999ace0241917a5" }, 33 | "nvim-ts-autotag": { "branch": "main", "commit": "a1d526af391f6aebb25a8795cbc05351ed3620b5" }, 34 | "nvim-ts-context-commentstring": { "branch": "main", "commit": "1b212c2eee76d787bbea6aa5e92a2b534e7b4f8f" }, 35 | "nvim-web-devicons": { "branch": "master", "commit": "19d6211c78169e78bab372b585b6fb17ad974e82" }, 36 | "plenary.nvim": { "branch": "master", "commit": "857c5ac632080dba10aae49dba902ce3abf91b35" }, 37 | "tabular": { "branch": "master", "commit": "12437cd1b53488e24936ec4b091c9324cafee311" }, 38 | "telescope-fzf-native.nvim": { "branch": "main", "commit": "1f08ed60cafc8f6168b72b80be2b2ea149813e55" }, 39 | "telescope.nvim": { "branch": "master", "commit": "d90956833d7c27e73c621a61f20b29fdb7122709" }, 40 | "vim-better-whitespace": { "branch": "master", "commit": "de99b55a6fe8c96a69f9376f16b1d5d627a56e81" }, 41 | "vim-helm": { "branch": "master", "commit": "cc5ac22444332381f38084a6c7f023c25eef6201" }, 42 | "vim-tmux-navigator": { "branch": "master", "commit": "412c474e97468e7934b9c217064025ea7a69e05e" }, 43 | "vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" }, 44 | "which-key.nvim": { "branch": "main", "commit": "370ec46f710e058c9c1646273e6b225acf47cbed" } 45 | } 46 | -------------------------------------------------------------------------------- /lua/core/options.lua: -------------------------------------------------------------------------------- 1 | ----------------------------------------------------------- 2 | -- General Neovim settings and configuration 3 | ----------------------------------------------------------- 4 | 5 | -- Default options are not included 6 | -- See: https://neovim.io/doc/user/vim_diff.html 7 | -- [2] Defaults - *nvim-defaults* 8 | 9 | local g = vim.g -- Global variables 10 | local opt = vim.opt -- Set options (global/buffer/windows-scoped) 11 | local cmd = vim.cmd 12 | 13 | ----------------------------------------------------------- 14 | -- General 15 | ----------------------------------------------------------- 16 | opt.mouse = 'a' -- Enable mouse support 17 | opt.clipboard = 'unnamedplus' -- Copy/paste to system clipboard 18 | opt.swapfile = false -- Don't use swapfile 19 | opt.completeopt = 'menuone,noinsert,noselect' -- Autocomplete options 20 | 21 | ----------------------------------------------------------- 22 | -- UI 23 | ----------------------------------------------------------- 24 | opt.number = true -- Show line number 25 | opt.numberwidth = 2 -- . 26 | opt.showmatch = true -- Highlight matching parenthesis 27 | opt.foldmethod = 'marker' -- Enable folding (default 'foldmarker') 28 | opt.colorcolumn = '80' -- Line lenght marker at 80 columns 29 | opt.splitright = true -- Vertical split to the right 30 | opt.splitbelow = true -- Horizontal split to the bottom 31 | opt.ignorecase = true -- Ignore case letters when search 32 | opt.smartcase = true -- Ignore lowercase for the whole pattern 33 | opt.linebreak = true -- Wrap on word boundary 34 | opt.termguicolors = true -- Enable 24-bit RGB colors 35 | opt.laststatus = 3 -- Set global statusline 36 | opt.showcmd = true -- show commands as we type them 37 | opt.scrolloff = 4 -- scroll the window when we get near the edge 38 | opt.sidescrolloff = 10 -- scroll the window when we get near the edge 39 | opt.cursorline = true -- . 40 | opt.ruler = true -- show current line info (current/total) 41 | opt.rulerformat = '%=%l/%L' -- Format ruler 42 | opt.display = 'lastline' -- When lines are ropped at the screen bottom, show as much as possible 43 | cmd.colorscheme "catppuccin" 44 | ----------------------------------------------------------- 45 | -- Search and Replace 46 | ----------------------------------------------------------- 47 | opt.incsearch = true 48 | opt.hlsearch = true 49 | opt.ignorecase = true -- searching is case insensitive when all lowercase 50 | opt.smartcase = true -- searching is case insensitive when all lowercase 51 | 52 | ----------------------------------------------------------- 53 | -- Tabs, indent 54 | ----------------------------------------------------------- 55 | opt.expandtab = true -- Use spaces instead of tabs 56 | opt.shiftwidth = 4 -- Shift 2 spaces when tab 57 | opt.tabstop = 4 -- 1 tab == 2 spaces 58 | opt.softtabstop = 4 -- Use 4 space as tabs 59 | opt.autoindent = true -- Match indentation of previous line 60 | opt.smartindent = true -- Autoindent new lines 61 | cmd.filetype 'on' -- Detect file plugin 62 | cmd.filetype "plugin indent on" -- perform autoindenting based on filetype plugin 63 | 64 | 65 | ----------------------------------------------------------- 66 | -- Memory, CPU 67 | ----------------------------------------------------------- 68 | opt.hidden = true -- Enable background buffers 69 | opt.history = 100 -- Remember N lines in history 70 | opt.lazyredraw = true -- Faster scrolling 71 | opt.synmaxcol = 240 -- Max column for syntax highlight 72 | opt.updatetime = 250 -- ms to wait for trigger an event 73 | 74 | ----------------------------------------------------------- 75 | -- Startup 76 | ----------------------------------------------------------- 77 | -- Disable nvim intro 78 | opt.shortmess:append "sI" 79 | 80 | -- -- Disable builtin plugins 81 | local disabled_built_ins = { 82 | "2html_plugin", 83 | "getscript", 84 | "getscriptPlugin", 85 | "gzip", 86 | "logipat", 87 | "netrw", 88 | "netrwPlugin", 89 | "netrwSettings", 90 | "netrwFileHandlers", 91 | "matchit", 92 | "tar", 93 | "tarPlugin", 94 | "rrhelper", 95 | "spellfile_plugin", 96 | "vimball", 97 | "vimballPlugin", 98 | "zip", 99 | "zipPlugin", 100 | "tutor", 101 | "rplugin", 102 | "synmenu", 103 | "optwin", 104 | "compiler", 105 | "bugreport", 106 | "ftplugin", 107 | } 108 | 109 | for _, plugin in pairs(disabled_built_ins) do 110 | g["loaded_" .. plugin] = 1 111 | end 112 | -------------------------------------------------------------------------------- /lua/plugins/lspconfig.lua: -------------------------------------------------------------------------------- 1 | return { 2 | { 3 | "mason-org/mason.nvim", 4 | opts = { 5 | PATH = 'append' 6 | }, 7 | }, 8 | { 9 | "mason-org/mason-lspconfig.nvim", 10 | opts = { 11 | ensure_installed = { 12 | "lua_ls", 13 | "solargraph", 14 | "pyright", 15 | "ruff", 16 | "gopls", 17 | "dockerls", 18 | "docker_compose_language_service", 19 | "sqlls", 20 | "helm_ls", 21 | "clangd", 22 | "groovyls", 23 | "rust_analyzer", 24 | }, 25 | }, 26 | 27 | dependencies = { 28 | { 29 | "mason-org/mason.nvim", opts = {} 30 | }, 31 | "neovim/nvim-lspconfig", 32 | }, 33 | }, 34 | { 35 | "neovim/nvim-lspconfig", 36 | event = { "BufReadPre", "BufNewFile" }, 37 | dependencies = { 38 | "hrsh7th/cmp-nvim-lsp", 39 | { "antosha417/nvim-lsp-file-operations", config = true }, 40 | }, 41 | config = function() 42 | local lspconfig = require("lspconfig") 43 | local cmp_nvim_lsp = require("cmp_nvim_lsp") 44 | 45 | local keymap = vim.keymap -- for conciseness 46 | local opts = { noremap = true, silent = true } 47 | local on_attach = function(client, bufnr) 48 | opts.buffer = bufnr 49 | 50 | -- set keybinds 51 | opts.desc = "Show LSP references" 52 | keymap.set("n", "gR", "Telescope lsp_references", opts) -- show definition, references 53 | 54 | opts.desc = "Go to declaration" 55 | keymap.set("n", "gD", vim.lsp.buf.declaration, opts) -- go to declaration 56 | 57 | opts.desc = "Show LSP definitions" 58 | keymap.set("n", "gd", "Telescope lsp_definitions", opts) -- show lsp definitions 59 | 60 | opts.desc = "Show LSP implementations" 61 | keymap.set("n", "gi", "Telescope lsp_implementations", opts) -- show lsp implementations 62 | 63 | opts.desc = "Show LSP type definitions" 64 | keymap.set("n", "gt", "Telescope lsp_type_definitions", opts) -- show lsp type definitions 65 | 66 | opts.desc = "See available code actions" 67 | keymap.set({ "n", "v" }, "ca", vim.lsp.buf.code_action, opts) -- see available code actions, in visual mode will apply to selection 68 | 69 | opts.desc = "Smart rename" 70 | keymap.set("n", "rn", vim.lsp.buf.rename, opts) -- smart rename 71 | 72 | opts.desc = "Show buffer diagnostics" 73 | keymap.set("n", "D", "Telescope diagnostics bufnr=0", opts) -- show diagnostics for file 74 | 75 | opts.desc = "Show line diagnostics" 76 | keymap.set("n", "d", vim.diagnostic.open_float, opts) -- show diagnostics for line 77 | 78 | opts.desc = "Go to previous diagnostic" 79 | keymap.set("n", "[d", vim.diagnostic.goto_prev, opts) -- jump to previous diagnostic in buffer 80 | 81 | opts.desc = "Go to next diagnostic" 82 | keymap.set("n", "]d", vim.diagnostic.goto_next, opts) -- jump to next diagnostic in buffer 83 | 84 | opts.desc = "Show documentation for what is under cursor" 85 | keymap.set("n", "K", vim.lsp.buf.hover, opts) -- show documentation for what is under cursor 86 | 87 | opts.desc = "Restart LSP" 88 | keymap.set("n", "rs", ":LspRestart", opts) -- mapping to restart lsp if necessary 89 | end 90 | 91 | local cmp_capabilities = cmp_nvim_lsp.default_capabilities() 92 | lspconfig.lua_ls.setup { 93 | capabilities = cmp_capabilities, 94 | on_attach = on_attach, 95 | settings = { 96 | Lua = { 97 | -- make the language server recognize "vim" global 98 | diagnostics = { 99 | globals = { "vim" }, 100 | }, 101 | workspace = { 102 | -- make language server aware of runtime files 103 | library = { 104 | [vim.fn.expand("$VIMRUNTIME/lua")] = true, 105 | [vim.fn.stdpath("config") .. "/lua"] = true, 106 | }, 107 | }, 108 | }, 109 | }, 110 | 111 | } 112 | lspconfig.solargraph.setup { 113 | capabilities = cmp_capabilities, 114 | on_attach = on_attach, 115 | } 116 | lspconfig.pyright.setup { 117 | capabilities = cmp_capabilities, 118 | on_attach = on_attach, 119 | } 120 | lspconfig.ruff.setup { 121 | on_attach = function(client, bufnr) 122 | -- Disable hover in favor of Pyright 123 | client.server_capabilities.hoverProvider = false 124 | end 125 | } 126 | lspconfig.gopls.setup { 127 | capabilities = cmp_capabilities, 128 | on_attach = on_attach, 129 | } 130 | lspconfig.dockerls.setup { 131 | capabilities = cmp_capabilities, 132 | on_attach = on_attach, 133 | } 134 | lspconfig.docker_compose_language_service.setup { 135 | capabilities = cmp_capabilities, 136 | on_attach = on_attach, 137 | } 138 | lspconfig.sqlls.setup { 139 | capabilities = cmp_capabilities, 140 | on_attach = on_attach, 141 | } 142 | lspconfig.helm_ls.setup { 143 | capabilities = cmp_capabilities, 144 | on_attach = function(client, bufnr) 145 | on_attach(client, bufnr) 146 | -- Disable formatting for YAML files 147 | client.server_capabilities.documentFormattingProvider = false 148 | client.server_capabilities.documentRangeFormattingProvider = false 149 | end, 150 | settings = { 151 | ['helm-ls'] = { 152 | yamlls = { 153 | path = "yaml-language-server", 154 | } 155 | } 156 | } 157 | } 158 | lspconfig.clangd.setup { 159 | capabilities = cmp_capabilities, 160 | on_attach = on_attach, 161 | } 162 | 163 | lspconfig.groovyls.setup { 164 | capabilities = cmp_capabilities, 165 | on_attach = on_attach, 166 | } 167 | 168 | lspconfig.rust_analyzer.setup { 169 | capabilities = cmp_capabilities, 170 | on_attach = on_attach, 171 | } 172 | 173 | -- Auto Format only for some extensions 174 | vim.api.nvim_create_autocmd("BufWritePre", { 175 | pattern = { "*.lua", "*.py", "*.go" }, 176 | buffer = buffer, 177 | callback = function() 178 | vim.lsp.buf.format { async = false } 179 | end 180 | }) 181 | -- Manual Format on demand 182 | vim.keymap.set("n", "F", vim.lsp.buf.format, { desc = "Format by LSP" }) 183 | end, 184 | } 185 | } 186 | --------------------------------------------------------------------------------