Compare commits
3 commits
7f67cabd57
...
30ef275312
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
30ef275312 | ||
|
|
d3a56f6513 | ||
|
|
c43196a300 |
3 changed files with 24 additions and 4 deletions
|
|
@ -1,8 +1,18 @@
|
||||||
vim.o.textwidth = 120
|
vim.o.textwidth = 120
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>o", function()
|
local function on_ts_ls_attach(ev)
|
||||||
vim.lsp.buf.execute_command({ command = "_typescript.organizeImports", arguments = { vim.fn.expand("%:p") } })
|
vim.keymap.set("n", "<leader>o", function()
|
||||||
end, { desc = "Organize imports" })
|
local client = vim.lsp.get_client_by_id(ev.data.client_id)
|
||||||
|
if not client then return end
|
||||||
|
return client:exec_cmd({
|
||||||
|
title = "Organize imports",
|
||||||
|
command = "_typescript.organizeImports",
|
||||||
|
arguments = { vim.api.nvim_buf_get_name(ev.buf) }
|
||||||
|
}, { bufnr = ev.buf })
|
||||||
|
end, { noremap = true, silent = true, buffer = ev.buf })
|
||||||
|
end
|
||||||
|
vim.api.nvim_create_autocmd("LspAttach", { callback = on_ts_ls_attach })
|
||||||
|
|
||||||
vim.keymap.set("n", "<leader>s", function()
|
vim.keymap.set("n", "<leader>s", function()
|
||||||
require("nvim-quick-switcher").toggle("tsx", "scss")
|
require("nvim-quick-switcher").toggle("tsx", "scss")
|
||||||
end, { buffer = true })
|
end, { buffer = true })
|
||||||
|
|
|
||||||
7
init.lua
7
init.lua
|
|
@ -1,3 +1,5 @@
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
local should_profile = os.getenv("NVIM_PROFILE")
|
local should_profile = os.getenv("NVIM_PROFILE")
|
||||||
if should_profile then
|
if should_profile then
|
||||||
require("profile").instrument_autocmds()
|
require("profile").instrument_autocmds()
|
||||||
|
|
@ -91,7 +93,6 @@ vim.opt.suffixes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
vim.opt.completeopt = "menu,menuone,noselect"
|
vim.opt.completeopt = "menu,menuone,noselect"
|
||||||
vim.opt.mouse = ""
|
|
||||||
vim.opt.shortmess = vim.o.shortmess .. "c"
|
vim.opt.shortmess = vim.o.shortmess .. "c"
|
||||||
|
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
|
|
@ -151,3 +152,7 @@ key("v", "gs", "<cmd>'<,'>sort<CR>", { desc = "sort selection" })
|
||||||
|
|
||||||
key("n", "<M-b>", "<cmd>bnext<cr>", { desc = "next buffer" })
|
key("n", "<M-b>", "<cmd>bnext<cr>", { desc = "next buffer" })
|
||||||
key("n", "<M-S-b>", "<cmd>bprevious<cr>", { desc = "previous buffer" })
|
key("n", "<M-S-b>", "<cmd>bprevious<cr>", { desc = "previous buffer" })
|
||||||
|
|
||||||
|
key("v", "<LeftRelease>", "\"*ygv")
|
||||||
|
key("v", "<2-LeftRelease>", "\"*ygv")
|
||||||
|
key("v", "<3-LeftRelease>", "\"*ygv")
|
||||||
|
|
|
||||||
5
lua/plugins/tree.lua
Normal file
5
lua/plugins/tree.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
return {
|
||||||
|
"nvim-tree/nvim-tree.lua",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
config = true
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue