My neovim config
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

somehting

+159 -52
+127 -52
init.lua
··· 1 1 local vim = vim 2 2 vim.pack.add({ 3 - { src = "https://github.com/stevearc/oil.nvim"}, 4 - { src = "https://github.com/nvim-mini/mini.icons"}, 5 - { src = "https://github.com/nvim-mini/mini.pick"}, 6 - { src = "https://github.com/scrooloose/nerdcommenter"}, 7 - { src = "https://github.com/smoka7/hop.nvim"}, 8 - { src = "https://github.com/folke/trouble.nvim"}, 3 + { src = "https://github.com/stevearc/oil.nvim" }, 4 + { src = "https://github.com/nvim-mini/mini.icons" }, 5 + { src = "https://github.com/nvim-mini/mini.pick" }, 6 + { src = "https://github.com/nvim-mini/mini.completion" }, 9 7 8 + { src = "https://github.com/smoka7/hop.nvim" }, 9 + { src = "https://github.com/folke/trouble.nvim" }, 10 10 -- themes 11 - { src = "https://github.com/vague-theme/vague.nvim"}, 12 - { src = "https://github.com/IroncladDev/osmium"}, 13 - 11 + { src = "https://github.com/vague-theme/vague.nvim" }, 12 + { src = "https://github.com/IroncladDev/osmium" }, 14 13 15 14 -- Mason / Lsp 16 15 { src = "https://github.com/mason-org/mason.nvim.git" }, 17 16 { src = "https://github.com/mason-org/mason-lspconfig.nvim.git" }, 18 17 { src = "https://github.com/neovim/nvim-lspconfig.git" }, 18 + { src = "https://github.com/nvim-lua/plenary.nvim" }, 19 + { src = "https://github.com/pmizio/typescript-tools.nvim" }, 20 + { src = "https://github.com/olrtg/nvim-emmet" }, 21 + { src = "https://github.com/stevearc/conform.nvim" }, 19 22 }) 20 23 21 24 vim.o.number = true 22 - vim.o.relativenumber=true 23 - vim.o.mouse = 'a' 25 + vim.o.relativenumber = true 26 + vim.o.mouse = "a" 24 27 vim.o.showmode = false 25 - vim.o.clipboard = 'unnamedplus' 28 + vim.o.clipboard = "unnamedplus" 26 29 vim.o.breakindent = true 27 30 vim.o.undofile = true 28 31 vim.o.ignorecase = true 29 32 vim.o.smartcase = true 30 - vim.o.signcolumn = 'yes' 33 + vim.o.signcolumn = "yes" 31 34 vim.o.updatetime = 250 32 35 vim.o.timeoutlen = 600 33 36 vim.o.splitright = true 34 37 vim.o.splitbelow = true 35 - vim.o.inccommand = 'split' 38 + vim.o.inccommand = "split" 36 39 vim.o.cursorline = true 37 40 vim.o.swapfile = false 38 41 vim.o.scrolloff = 10 ··· 41 44 vim.o.wrap = false 42 45 vim.o.tabstop = 4 43 46 vim.o.shiftwidth = 4 44 - vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' } 47 + vim.opt.listchars = { tab = "» ", trail = "·", nbsp = "␣" } 45 48 46 - vim.g.mapleader = ' ' 47 - vim.g.maplocalleader = ' ' 49 + vim.g.mapleader = " " 50 + vim.g.maplocalleader = " " 48 51 vim.g.have_nerd_font = true 49 52 vim.o.winborder = "rounded" 50 53 54 + require("osmium").setup({ 55 + integrations = { 56 + gitsigns = false, 57 + telescope = true, 58 + indent_blankline = false, 59 + fff = false, 60 + }, 61 + transparent_bg = false, -- whether to use a transparent background 62 + show_end_of_buffer = false, -- whether to show the end of buffer 63 + }) 64 + 51 65 vim.cmd("colorscheme osmium") 52 66 vim.cmd(":hi statusline guibg=NONE") 53 67 68 + local keymaps = function() 69 + vim.keymap.set("n", "<leader>e", vim.diagnostic.open_float, { desc = "Show diagnostic [E]rror messages" }) 70 + vim.keymap.set("n", "<leader>q", vim.diagnostic.setloclist, { desc = "Open diagnostic [Q]uickfix list" }) 71 + vim.keymap.set("n", "<leader>fb", "<CMD>Oil<CR>", { desc = "[F]ile [B]rowser" }) 72 + vim.keymap.set("n", "<leader>sf", "<CMD>Pick files<CR>", { desc = "[S]earch [F]iles" }) 73 + vim.keymap.set("n", "<leader>sg", "<CMD>Pick grep_live<CR>", { desc = "[S]earch by [G]rep" }) 74 + vim.keymap.set("n", "<leader>sr", "<CMD>Pick resume<CR>", { desc = "[S]earch [R]esume" }) 75 + vim.keymap.set({ "n", "v" }, "<leader>xe", require("nvim-emmet").wrap_with_abbreviation) 76 + vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, { desc = "[C]ode [A]ction" }) 77 + vim.keymap.set("n", "<leader>rn", vim.lsp.buf.rename, { desc = "[R]e[n]ame" }) 78 + vim.keymap.set("n", "gd", vim.lsp.buf.definition, { desc = "[G]oto [D]efinition" }) 79 + vim.keymap.set("n", "gr", vim.lsp.buf.references, { desc = "[G]oto [R]eferences" }) 80 + vim.keymap.set("n", "gD", vim.lsp.buf.declaration, { desc = "[G]oto [D]eclaration" }) 81 + vim.keymap.set("n", "gi", vim.lsp.buf.implementation, { desc = "[G]oto [I]mplementation" }) 82 + vim.keymap.set({ "i", "s" }, "<C-j>", function() 83 + if vim.snippet.active({ direction = 1 }) then 84 + vim.snippet.jump(1) 85 + end 86 + end, { desc = "Jump snippet next" }) 87 + vim.keymap.set({ "i", "s" }, "<C-k>", function() 88 + if vim.snippet.active({ direction = -1 }) then 89 + vim.snippet.jump(-1) 90 + end 91 + end, { desc = "Jump snippet back" }) 92 + end 54 93 55 - vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) 56 - vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) 57 - vim.keymap.set('n', '<leader>fb', '<CMD>Oil<CR>', { desc = '[F]ile [B]rowser' }) 94 + require("mini.pick").setup({}) 95 + require("mini.completion").setup({ 96 + delay = { completion = 10000000, info = 100, signature = 50 }, 97 + lsp_completion = { 98 + source_func = "omnifunc", 99 + auto_setup = true, 100 + }, 101 + }) 58 102 59 - require("mini.pick").setup({}) 60 - vim.keymap.set('n', '<leader>sf', "<CMD>Pick files<CR>", { desc = '[S]earch [F]iles' }) 61 - vim.keymap.set('n', '<leader>sg', "<CMD>Pick grep_live<CR>", { desc = '[S]earch by [G]rep' }) 62 - vim.keymap.set('n', '<leader>sr', "<CMD>Pick resume<CR>", { desc = '[S]earch [R]esume' }) 103 + vim.keymap.set("i", "<Tab>", function() 104 + if vim.fn.pumvisible() == 1 then 105 + return "<C-y>" 106 + elseif vim.snippet.active({ direction = 1 }) then 107 + return "<Cmd>lua vim.snippet.jump(1)<CR>" 108 + else 109 + return "<Tab>" 110 + end 111 + end, { expr = true, desc = "Accept completion or jump snippet" }) 63 112 64 - local lsp_ensure_installed = { 65 - "lua_ls", "emmet_ls", "oxlint", "ts_ls", "tailwindcss" 113 + local ensure_installed = { 114 + lsp = { "lua_ls", "emmet_ls", "oxlint", "tailwindcss" }, 115 + treesitter = { "lua", "typescript", "javascript", "tsx", "html", "css" }, 66 116 } 67 117 118 + local setup_conform = function() 119 + require("conform").setup({ 120 + format_on_save = { timeout_ms = 500, lsp_fallback = true }, 121 + formatters_by_ft = { 122 + lua = { "stylua" }, 123 + javascript = { "oxfmt", "prettierd", "prettier", stop_after_first = true }, 124 + typescript = { "oxfmt", "prettierd", "prettier", stop_after_first = true }, 125 + typescriptreact = { "oxfmt", "prettierd", "prettier", stop_after_first = true }, 126 + javascriptreact = { "oxfmt", "prettierd", "prettier", stop_after_first = true }, 127 + json = { "prettierd", "prettier", stop_after_first = true }, 128 + html = { "prettierd", "prettier", stop_after_first = true }, 129 + css = { "prettierd", "prettier", stop_after_first = true }, 130 + }, 131 + }) 132 + end 68 133 69 134 local setup_oil = function() 70 - 71 135 ---@module 'oil' 72 136 ---@type oil.SetupOpts 73 137 local opts = { 74 138 default_file_explorer = true, 75 - columns={ 76 - 'icon', 139 + columns = { 140 + "icon", 77 141 }, 78 142 view_options = { 79 143 show_hidden = true, 80 144 is_hidden_file = function(name) 81 - return name ~= '..' and vim.startswith(name, '.') 82 - end 83 - } 145 + return name ~= ".." and vim.startswith(name, ".") 146 + end, 147 + }, 84 148 } 85 149 require("oil").setup(opts) 86 150 require("mini.icons").setup({}) ··· 89 153 local setup_mason = function() 90 154 require("mason").setup() 91 155 require("mason-lspconfig").setup({ 92 - ensure_installed = lsp_ensure_installed, 156 + ensure_installed = ensure_installed.lsp, 93 157 }) 94 158 end 95 159 96 - 97 160 -- hop 98 161 local setup_hop = function() 99 - local hop = require('hop') 100 - local directions = require('hop.hint').HintDirection 162 + local hop = require("hop") 163 + local directions = require("hop.hint").HintDirection 101 164 102 - local hopmap = function(key, direction, current_line_only) 103 - vim.keymap.set('', key, function() 104 - hop.hint_char1({ 105 - direction = direction, 106 - current_line_only = current_line_only 107 - }) 108 - end, { remap = true} 109 - ) 110 - end 165 + local hopmap = function(key, direction, current_line_only) 166 + vim.keymap.set("", key, function() 167 + hop.hint_char1({ 168 + direction = direction, 169 + current_line_only = current_line_only, 170 + }) 171 + end, { remap = true }) 172 + end 111 173 112 - hopmap('f', directions.AFTER_CURSOR, false) 113 - hopmap('F', directions.BEFORE_CURSOR, false) 114 - hopmap('t', directions.AFTER_CURSOR, true) 115 - hopmap('T', directions.BEFORE_CURSOR, true) 174 + hopmap("f", directions.AFTER_CURSOR, false) 175 + hopmap("F", directions.BEFORE_CURSOR, false) 176 + hopmap("t", directions.AFTER_CURSOR, true) 177 + hopmap("T", directions.BEFORE_CURSOR, true) 116 178 117 - hop.setup { 118 - keys = 'etovxqpdygfblzhckisuran', 119 - } 179 + hop.setup({ 180 + keys = "etovxqpdygfblzhckisuran", 181 + }) 120 182 end 121 183 -- 122 184 185 + local setup_treesitter = function() 186 + for _, lang in ipairs(ensure_installed.treesitter) do 187 + vim.treesitter.language.add(lang) 188 + end 189 + end 190 + 191 + local setup_typescript_tools = function() 192 + require("typescript-tools").setup({}) 193 + end 123 194 124 195 -- Plugin setup 125 196 setup_mason() 126 197 setup_oil() 127 198 setup_hop() 199 + setup_treesitter() 200 + setup_conform() 201 + setup_typescript_tools() 202 + keymaps()
+32
nvim-pack-lock.json
··· 1 1 { 2 2 "plugins": { 3 + "LuaSnip": { 4 + "rev": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c", 5 + "src": "https://github.com/L3MON4D3/LuaSnip" 6 + }, 7 + "conform.nvim": { 8 + "rev": "c2526f1cde528a66e086ab1668e996d162c75f4f", 9 + "src": "https://github.com/stevearc/conform.nvim" 10 + }, 3 11 "hop.nvim": { 4 12 "rev": "1a1eceafe54b5081eae4cb91c723abd1d450f34b", 5 13 "src": "https://github.com/phaazon/hop.nvim" ··· 12 20 "rev": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65", 13 21 "src": "https://github.com/mason-org/mason.nvim.git" 14 22 }, 23 + "mini.completion": { 24 + "rev": "4d451f82f193f6751719935a63d16ccb79a76e0b", 25 + "src": "https://github.com/nvim-mini/mini.completion" 26 + }, 15 27 "mini.icons": { 16 28 "rev": "efc85e42262cd0c9e1fdbf806c25cb0be6de115c", 17 29 "src": "https://github.com/echasnovski/mini.icons" ··· 19 31 "mini.pick": { 20 32 "rev": "7c0a674f620ddc701903b887b2dade836b23ea79", 21 33 "src": "https://github.com/nvim-mini/mini.pick" 34 + }, 35 + "mini.snippets": { 36 + "rev": "b4065ca6b33e4df2897672d3bb760cfc93f4390a", 37 + "src": "https://github.com/nvim-mini/mini.snippets" 22 38 }, 23 39 "nerdcommenter": { 24 40 "rev": "a462bbda1e26f44fb3d3eb9d9d1c6a07aa98e665", 25 41 "src": "https://github.com/scrooloose/nerdcommenter" 26 42 }, 43 + "nvim-emmet": { 44 + "rev": "cde4fb2968704aae5c18b7f8a9bc2508767bb78d", 45 + "src": "https://github.com/olrtg/nvim-emmet" 46 + }, 27 47 "nvim-lspconfig": { 28 48 "rev": "dec357ee48ff7e2e5b76898fd7c67b61a627d3ac", 29 49 "src": "https://github.com/neovim/nvim-lspconfig" 50 + }, 51 + "nvim-treesitter": { 52 + "rev": "f8bbc3177d929dc86e272c41cc15219f0a7aa1ac", 53 + "src": "https://github.com/nvim-treesitter/nvim-treesitter" 30 54 }, 31 55 "oil.nvim": { 32 56 "rev": "f55b25e493a7df76371cfadd0ded5004cb9cd48a", ··· 36 60 "rev": "ac55489a2d86c8cadf87fc062f10992b3ed286eb", 37 61 "src": "https://github.com/IroncladDev/osmium" 38 62 }, 63 + "plenary.nvim": { 64 + "rev": "b9fd5226c2f76c951fc8ed5923d85e4de065e509", 65 + "src": "https://github.com/nvim-lua/plenary.nvim" 66 + }, 39 67 "trouble.nvim": { 40 68 "rev": "bd67efe408d4816e25e8491cc5ad4088e708a69a", 41 69 "src": "https://github.com/folke/trouble.nvim" 70 + }, 71 + "typescript-tools.nvim": { 72 + "rev": "c2f5910074103705661e9651aa841e0d7eea9932", 73 + "src": "https://github.com/pmizio/typescript-tools.nvim" 42 74 }, 43 75 "vague.nvim": { 44 76 "rev": "fcc283576764474ccfbbcca240797d5d7f4d8a78",