diff options
Diffstat (limited to 'nvim')
| -rw-r--r-- | nvim/after/ftplugin/css.lua | 3 | ||||
| -rw-r--r-- | nvim/after/ftplugin/html.lua | 3 | ||||
| -rw-r--r-- | nvim/lazy-lock.json | 2 | ||||
| -rw-r--r-- | nvim/lua/kkard2/lazy.lua | 12 | ||||
| -rw-r--r-- | nvim/lua/kkard2/lazy/lsp.lua | 53 | ||||
| -rw-r--r-- | nvim/lua/kkard2/remap.lua | 4 |
6 files changed, 69 insertions, 8 deletions
diff --git a/nvim/after/ftplugin/css.lua b/nvim/after/ftplugin/css.lua new file mode 100644 index 0000000..ed7f6bb --- /dev/null +++ b/nvim/after/ftplugin/css.lua @@ -0,0 +1,3 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 diff --git a/nvim/after/ftplugin/html.lua b/nvim/after/ftplugin/html.lua new file mode 100644 index 0000000..ed7f6bb --- /dev/null +++ b/nvim/after/ftplugin/html.lua @@ -0,0 +1,3 @@ +vim.opt.tabstop = 2 +vim.opt.softtabstop = 2 +vim.opt.shiftwidth = 2 diff --git a/nvim/lazy-lock.json b/nvim/lazy-lock.json index b916c8f..5d1175d 100644 --- a/nvim/lazy-lock.json +++ b/nvim/lazy-lock.json @@ -14,6 +14,8 @@ "nvim-treesitter": { "branch": "master", "commit": "e8648569d82c7bb46dc511cda9dbec687774461f" }, "nvim-web-devicons": { "branch": "master", "commit": "efbfed0567ef4bfac3ce630524a0f6c8451c5534" }, "plenary.nvim": { "branch": "master", "commit": "267282a9ce242bbb0c5dc31445b6d353bed978bb" }, + "repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" }, + "surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, "telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" }, "trouble.nvim": { "branch": "main", "commit": "40aad004f53ae1d1ba91bcc5c29d59f07c5f01d3" }, "undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" } diff --git a/nvim/lua/kkard2/lazy.lua b/nvim/lua/kkard2/lazy.lua index 4a436a4..e4029ef 100644 --- a/nvim/lua/kkard2/lazy.lua +++ b/nvim/lua/kkard2/lazy.lua @@ -17,12 +17,10 @@ require("lazy").setup({ { "catppuccin/nvim", name = "catppuccin", - lazy = false, config = require("kkard2.lazy.catppuccin"), }, { "nvim-treesitter/nvim-treesitter", - lazy = false, config = require("kkard2.lazy.treesitter"), }, { @@ -33,7 +31,6 @@ require("lazy").setup({ }, { "nvim-lualine/lualine.nvim", - lazy = false, config = function() require("lualine").setup({}) end, }, { @@ -86,12 +83,11 @@ require("lazy").setup({ }, }, { - lazy = false, "echasnovski/mini.trailspace", config = function() require("mini.trailspace").setup() end, }, - { - lazy = false, - "github/copilot.vim", - }, + + { "github/copilot.vim" }, + { "https://tpope.io/vim/repeat.git" }, + { "https://tpope.io/vim/surround.git" }, }) diff --git a/nvim/lua/kkard2/lazy/lsp.lua b/nvim/lua/kkard2/lazy/lsp.lua index 08d22d1..a4d24ad 100644 --- a/nvim/lua/kkard2/lazy/lsp.lua +++ b/nvim/lua/kkard2/lazy/lsp.lua @@ -1,3 +1,43 @@ +-- WARNING: BAD CODE AHEAD +-- look at your own risk +local function rename_file() + local source_file, target_file + + vim.ui.input({ + prompt = "Source : ", + completion = "file", + default = vim.api.nvim_buf_get_name(0) + }, + function(input) + source_file = input + end + ) + vim.ui.input({ + prompt = "Target : ", + completion = "file", + default = source_file + }, + function(input) + target_file = input + end + ) + + local params = { + command = "_typescript.applyRenameFile", + arguments = { + { + sourceUri = source_file, + targetUri = target_file, + }, + }, + title = "" + } + + vim.lsp.util.rename(source_file, target_file) + vim.lsp.buf.execute_command(params) +end +-- END OF WARNING + return function() local lsp = require("lsp-zero").preset({}) @@ -16,4 +56,17 @@ return function() vim.keymap.set("n", "<leader>lr", vim.lsp.buf.rename) vim.keymap.set("n", "<leader><CR>", vim.lsp.buf.code_action) vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format) + + + + -- temp + require("lspconfig").tsserver.setup({ + commands = { + RenameFile = { + rename_file, + description = "Rename File" + }, + } + }) + -- end temp end diff --git a/nvim/lua/kkard2/remap.lua b/nvim/lua/kkard2/remap.lua index fda1ace..cd9aba2 100644 --- a/nvim/lua/kkard2/remap.lua +++ b/nvim/lua/kkard2/remap.lua @@ -28,3 +28,7 @@ vim.keymap.set("n", "<Esc>", function() vim.cmd(":q") end end) + +-- lmao +vim.keymap.set("i", "<S-Tab>", "<Esc>0d$?.<CR><cmd>noh<CR>0yw<C-o>0\"_d$pa") +vim.keymap.set("n", "<C-j>", "xi<CR><Esc>f ") |
