diff --git a/home/nvim/init.lua b/home/nvim/init.lua deleted file mode 100644 index b57e106..0000000 --- a/home/nvim/init.lua +++ /dev/null @@ -1,84 +0,0 @@ -require("plugin_specs") - -local keymap = vim.keymap -local opt = vim.opt -local api = vim.api - -vim.g.loaded_netrw = 1 -vim.g.loaded_netrwPlugin = 1 -vim.opt.termguicolors = true -require("nvim-tree").setup() - -require("lualine").setup({ - options = { - theme = "auto", - icons_enabled = true, - globalstatus = true, - }, -}) - -require("gitsigns").setup() - -opt.tabstop = 2 -opt.softtabstop = 2 -opt.shiftwidth = 2 -opt.expandtab = true -opt.relativenumber = true -opt.ignorecase = true -opt.smartcase = true -opt.scrolloff = 3 -opt.confirm = true -opt.history = 500 -opt.undofile = true -opt.termguicolors = true -opt.showmode = false -opt.mouse = "" -opt.wrap = false -opt.clipboard:append("unnamedplus") - -vim.cmd.colorscheme("iceberg") - --- restore terminal cursor on exit -api.nvim_create_autocmd("VimLeave", { - callback = function() - opt.guicursor = "a:ver25-blinkon500-blinkon500" - end, -}) - --- blinking cursor in insert mode -opt.guicursor = "i-ci-ve:ver25-blinkon500-blinkon500" - -keymap.set("n", "s", require("nvim-tree.api").tree.toggle, { - desc = "toggle nvim-tree", - silent = true, -}) - --- shortcut to command mode -keymap.set({ "n", "x" }, ";", ":", { silent = true }) - -keymap.set("n", "o", "printf('m`%so``', v:count1)", { - expr = true, - desc = "insert line below without moving cursor", -}) - -keymap.set("n", "O", "printf('m`%sO``', v:count1)", { - expr = true, - desc = "insert line above without moving cursor", -}) - -keymap.set("n", "/", [[/\v]]) - -keymap.set("n", "c", '"_c') -keymap.set("n", "C", '"_C') -keymap.set("n", "cc", '"_cc') -keymap.set("x", "c", '"_c') -keymap.set("x", "p", '"_cp') - --- Break inserted text into smaller undo units when we insert some punctuation chars. -local undo_ch = { ",", ".", "!", "?", ";", ":" } -for _, ch in ipairs(undo_ch) do - keymap.set("i", ch, ch .. "u") -end - -keymap.set("i", "", "") -keymap.set("i", "", "") diff --git a/home/nvim/lazy-lock.json b/home/nvim/lazy-lock.json deleted file mode 100644 index b35ef9f..0000000 --- a/home/nvim/lazy-lock.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" }, - "cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" }, - "cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" }, - "cmp-nvim-lsp": { "branch": "main", "commit": "99290b3ec1322070bcfb9e846450a46f6efa50f0" }, - "cmp-omni": { "branch": "main", "commit": "4ef610bbd85a5ee4e97e09450c0daecbdc60de86" }, - "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, - "cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" }, - "dressing.nvim": { "branch": "master", "commit": "3a45525bb182730fe462325c99395529308f431e" }, - "fzf-lua": { "branch": "main", "commit": "3d7e5db8fa56cfc2b92a38999016a51abe9e1d23" }, - "gitsigns.nvim": { "branch": "main", "commit": "b544bd62623ca1b483d8b9bfb6d65805f112a320" }, - "hop.nvim": { "branch": "master", "commit": "08ddca799089ab96a6d1763db0b8adc5320bf050" }, - "iceberg.vim": { "branch": "master", "commit": "23835d5ed696436f716cbfdb56a93a7850fe3b18" }, - "lazy.nvim": { "branch": "main", "commit": "d8f26efd456190241afd1b0f5235fe6fdba13d4a" }, - "lualine.nvim": { "branch": "master", "commit": "2a5bae925481f999263d6f5ed8361baef8df4f83" }, - "nvim-autopairs": { "branch": "master", "commit": "b464658e9b880f463b9f7e6ccddd93fb0013f559" }, - "nvim-cmp": { "branch": "main", "commit": "8c82d0bd31299dbff7f8e780f5e06d2283de9678" }, - "nvim-lspconfig": { "branch": "master", "commit": "8121483b8132b7053120fafd83728178fb3febf6" }, - "nvim-tree.lua": { "branch": "master", "commit": "68fc4c20f5803444277022c681785c5edd11916d" }, - "nvim-treesitter": { "branch": "master", "commit": "622a4a6ba76d1de52b72a965159213ae655b4ac7" }, - "nvim-web-devicons": { "branch": "master", "commit": "5740b7382429d20b6ed0bbdb0694185af9507d44" }, - "tokyonight.nvim": { "branch": "main", "commit": "7bb270adaa7692c2c33befc35f5567fc596a2504" }, - "vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" } -} diff --git a/home/nvim/lua/config/fzf.lua b/home/nvim/lua/config/fzf.lua deleted file mode 100644 index c96f06d..0000000 --- a/home/nvim/lua/config/fzf.lua +++ /dev/null @@ -1,21 +0,0 @@ -local keymap = vim.keymap - -local fzf = require("fzf-lua") - -keymap.set("n", "ff", fzf.files, { silent = true }) -keymap.set("n", "fr", fzf.oldfiles, { silent = true }) -keymap.set("n", "fc", fzf.resume, { silent = true }) -keymap.set("n", "fs", fzf.treesitter, { silent = true }) -keymap.set("n", "fg", fzf.grep_project, { silent = true }) - -fzf.setup({ - "fzf-native", - keymap = { - fzf = { - ["ctrl-u"] = "half-page-up", - ["ctrl-d"] = "half-page-down", - ["ctrl-j"] = "preview-page-down", - ["ctrl-k"] = "preview-page-up", - }, - }, -}) diff --git a/home/nvim/lua/config/hop.lua b/home/nvim/lua/config/hop.lua deleted file mode 100644 index 3724b9f..0000000 --- a/home/nvim/lua/config/hop.lua +++ /dev/null @@ -1,16 +0,0 @@ -local hop = require("hop") -local keymap = vim.keymap - -hop.setup({ - case_insensitive = true, - char2_fallback_key = "", - quit_key = "", "", { - silent = true, - noremap = true, - callback = function() - hop.hint_char1() - end, -}) diff --git a/home/nvim/lua/config/lsp.lua b/home/nvim/lua/config/lsp.lua deleted file mode 100644 index 149163b..0000000 --- a/home/nvim/lua/config/lsp.lua +++ /dev/null @@ -1,74 +0,0 @@ -local lsp = vim.lsp -local diagnostic = vim.diagnostic -local keymap = vim.keymap - -keymap.set("n", "gd", lsp.buf.definition) -keymap.set("n", "rn", lsp.buf.rename) -keymap.set("n", "gr", lsp.buf.references) -keymap.set("n", "[d", diagnostic.goto_prev) -keymap.set("n", "]d", diagnostic.goto_next) - -diagnostic.config({ - signs = false, -}) - -local lspconfig = require("lspconfig") -local capabilities = require("cmp_nvim_lsp").default_capabilities() - -lspconfig.pylsp.setup({ capabilities = capabilities }) -lspconfig.clangd.setup({ capabilities = capabilities }) -lspconfig.bashls.setup({ capabilities = capabilities }) -lspconfig.rust_analyzer.setup({ - capabilities = capabilities, -}) - -lspconfig.gopls.setup({ - settings = { - gopls = { - analyses = { - unusedparams = true, - }, - staticcheck = true, - gofumpt = true, - }, - }, - capabilities = capabilities, -}) - -lspconfig.lua_ls.setup({ - capabilities = capabilities, - on_init = function(client) - if client.workspace_folders then - local path = client.workspace_folders[1].name - if vim.uv.fs_stat(path .. "/.luarc.json") or vim.uv.fs_stat(path .. "/.luarc.jsonc") then - return - end - end - - client.config.settings.Lua = vim.tbl_deep_extend("force", client.config.settings.Lua, { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = "LuaJIT", - }, - -- Make the server aware of Neovim runtime files - workspace = { - checkThirdParty = false, - library = { - vim.env.VIMRUNTIME, - -- Depending on the usage, you might want to add additional paths here. - -- "${3rd}/luv/library" - -- "${3rd}/busted/library", - }, - -- or pull in all of 'runtimepath'. NOTE: this is a lot slower - -- library = vim.api.nvim_get_runtime_file("", true) - }, - }) - end, - settings = { - Lua = {}, - }, -}) - -lspconfig.nixd.setup({ capabilities = capabilities }) -lspconfig.terraformls.setup({ capabilities = capabilities }) diff --git a/home/nvim/lua/config/nvim-cmp.lua b/home/nvim/lua/config/nvim-cmp.lua deleted file mode 100644 index de42470..0000000 --- a/home/nvim/lua/config/nvim-cmp.lua +++ /dev/null @@ -1,54 +0,0 @@ -local cmp = require("cmp") -local luasnip = require("luasnip") - -cmp.setup({ - snippet = { - expand = function(args) - require("luasnip").lsp_expand(args.body) - end, - }, - mapping = { - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - if luasnip.expandable() then - luasnip.expand() - else - cmp.confirm({ - select = true, - }) - end - else - fallback() - end - end), - - [""] = cmp.mapping(function(fallback) - if cmp.visible() then - cmp.select_next_item() - elseif luasnip.locally_jumpable(1) then - luasnip.jump(1) - 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 = cmp.config.sources({ - { name = "nvim_lsp" }, - { name = "luasnip" }, - }, { - { name = "buffer" }, - { name = "path" }, - }), -}) diff --git a/home/nvim/lua/plugin_specs.lua b/home/nvim/lua/plugin_specs.lua deleted file mode 100644 index a51272e..0000000 --- a/home/nvim/lua/plugin_specs.lua +++ /dev/null @@ -1,99 +0,0 @@ --- Bootstrap lazy.nvim -local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" -if not (vim.uv or vim.loop).fs_stat(lazypath) then - local lazyrepo = "https://github.com/folke/lazy.nvim.git" - local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) - if vim.v.shell_error ~= 0 then - vim.api.nvim_echo({ - { "Failed to clone lazy.nvim:\n", "ErrorMsg" }, - { out, "WarningMsg" }, - { "\nPress any key to exit..." }, - }, true, {}) - vim.fn.getchar() - os.exit(1) - end -end -vim.opt.rtp:prepend(lazypath) - -vim.g.mapleader = "," - -local plugin_specs = { - { - "nvim-treesitter/nvim-treesitter", - build = ":TSUpdate", - event = "VeryLazy", - }, - - { - "neovim/nvim-lspconfig", - event = { "BufRead", "BufNewFile" }, - config = function() - require("config.lsp") - end, - }, - - { - "hrsh7th/nvim-cmp", - event = "VeryLazy", - dependencies = { - "hrsh7th/cmp-nvim-lsp", - "hrsh7th/cmp-path", - "hrsh7th/cmp-buffer", - "hrsh7th/cmp-omni", - "hrsh7th/cmp-cmdline", - "saadparwaiz1/cmp_luasnip", - }, - config = function() - require("config.nvim-cmp") - end, - }, - - { - "L3MON4D3/LuaSnip", - version = "v2.*", - build = "make install_jsregexp", - }, - - { "stevearc/dressing.nvim", event = "VeryLazy" }, - - { - "nvim-tree/nvim-tree.lua", - lazy = false, - dependencies = { - "nvim-tree/nvim-web-devicons", - }, - }, - - { - "ibhagwan/fzf-lua", - dependencies = { "nvim-tree/nvim-web-devicons" }, - config = function() - require("config.fzf") - end, - }, - - { "windwp/nvim-autopairs", event = "InsertEnter", config = true }, - - { "tpope/vim-commentary", event = "VeryLazy" }, - - { "folke/tokyonight.nvim", lazy = false, priority = 1000 }, - - { "lewis6991/gitsigns.nvim" }, - - { "nvim-lualine/lualine.nvim", dependencies = { "nvim-tree/nvim-web-devicons" } }, - - { - "smoka7/hop.nvim", - version = "*", - config = function() - require("config.hop") - end, - }, - - { "cocopon/iceberg.vim" }, -} - -require("lazy").setup({ - spec = plugin_specs, - rocks = { enabled = true }, -})