feat: Added typescript-tools and eslint
This commit is contained in:
@@ -172,6 +172,7 @@ require("lazy").setup({
|
||||
|
||||
map("K", vim.lsp.buf.hover, "Hover documentation")
|
||||
map("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
|
||||
map("<leader>e", vim.diagnostic.open_float, "Open hovering diagnostics")
|
||||
|
||||
-- Rename the variable under your cursor.
|
||||
-- Most Language Servers support renaming across files, etc.
|
||||
@@ -332,7 +333,9 @@ require("lazy").setup({
|
||||
-- But for many setups, the LSP (`ts_ls`) will work just fine
|
||||
-- ts_ls = {},
|
||||
--
|
||||
tsgo = {},
|
||||
-- tsgo = {},
|
||||
|
||||
eslint = {},
|
||||
|
||||
lua_ls = {
|
||||
-- cmd = { ... },
|
||||
@@ -411,7 +414,7 @@ require("lazy").setup({
|
||||
return nil
|
||||
else
|
||||
return {
|
||||
timeout_ms = 500,
|
||||
timeout_ms = 5000,
|
||||
lsp_format = "fallback",
|
||||
}
|
||||
end
|
||||
@@ -423,6 +426,7 @@ require("lazy").setup({
|
||||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
typescript = { "prettier" },
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -485,7 +489,7 @@ require("lazy").setup({
|
||||
-- <c-k>: Toggle signature help
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
preset = "default",
|
||||
preset = "super-tab",
|
||||
|
||||
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
|
||||
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
|
||||
@@ -548,6 +552,65 @@ require("lazy").setup({
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
"pmizio/typescript-tools.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim", "neovim/nvim-lspconfig" },
|
||||
opts = {},
|
||||
config = function()
|
||||
require("typescript-tools").setup({
|
||||
settings = {
|
||||
log = "verbose",
|
||||
-- spawn additional tsserver instance to calculate diagnostics on it
|
||||
separate_diagnostic_server = true,
|
||||
-- "change"|"insert_leave" determine when the client asks the server about diagnostic
|
||||
publish_diagnostic_on = "insert_leave",
|
||||
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
|
||||
-- "remove_unused_imports"|"organize_imports") -- or string "all"
|
||||
-- to include all supported code actions
|
||||
-- specify commands exposed as code_actions
|
||||
expose_as_code_action = {},
|
||||
-- string|nil - specify a custom path to `tsserver.js` file, if this is nil or file under path
|
||||
-- not exists then standard path resolution strategy is applied
|
||||
tsserver_path = nil,
|
||||
-- specify a list of plugins to load by tsserver, e.g., for support `styled-components`
|
||||
-- (see 💅 `styled-components` support section)
|
||||
tsserver_plugins = {},
|
||||
-- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
|
||||
-- memory limit in megabytes or "auto"(basically no limit)
|
||||
tsserver_max_memory = "auto",
|
||||
-- described below
|
||||
tsserver_format_options = {},
|
||||
tsserver_file_preferences = {},
|
||||
-- locale of all tsserver messages, supported locales you can find here:
|
||||
-- https://github.com/microsoft/TypeScript/blob/3c221fc086be52b19801f6e8d82596d04607ede6/src/compiler/utilitiesPublic.ts#L620
|
||||
tsserver_locale = "en",
|
||||
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
|
||||
complete_function_calls = false,
|
||||
include_completions_with_insert_text = true,
|
||||
-- CodeLens
|
||||
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
|
||||
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
|
||||
code_lens = "off",
|
||||
-- by default code lenses are displayed on all referencable values and for some of you it can
|
||||
-- be too much this option reduce count of them by removing member references from lenses
|
||||
disable_member_code_lens = true,
|
||||
-- JSXCloseTag
|
||||
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
|
||||
-- that maybe have a conflict if enable this feature. )
|
||||
jsx_close_tag = {
|
||||
enable = false,
|
||||
filetypes = { "javascriptreact", "typescriptreact" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"fatih/vim-go",
|
||||
build = ":GoUpdateBinaries",
|
||||
},
|
||||
|
||||
-- Multi-cursor
|
||||
{
|
||||
"mg979/vim-visual-multi",
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "7d527c76c43f46294de9c19d39c5a86317809b4b" },
|
||||
"mason-tool-installer.nvim": { "branch": "main", "commit": "517ef5994ef9d6b738322664d5fdd948f0fdeb46" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "b7c48a7111534b66bee077da8035ac7208a294ff" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
@@ -20,7 +21,9 @@
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "83a3a713d6b2d2a408491a1b959e55a7fa8678e8" },
|
||||
"typescript-tools.nvim": { "branch": "master", "commit": "c2f5910074103705661e9651aa841e0d7eea9932" },
|
||||
"ultisnips": { "branch": "master", "commit": "b22a86f9dcc5257624bff3c72d8b902eac468aad" },
|
||||
"vim-go": { "branch": "master", "commit": "dc07b9082fecd47f8ebef5f2684758e570f66377" },
|
||||
"vim-visual-multi": { "branch": "master", "commit": "a6975e7c1ee157615bbc80fc25e4392f71c344d4" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
}
|
||||
|
||||
@@ -5,10 +5,22 @@ vim.g.have_nerd_font = false
|
||||
|
||||
vim.o.colorcolumn = "80"
|
||||
vim.o.background = "dark"
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
|
||||
vim.g.clipboard = {
|
||||
name = "OSC 52",
|
||||
copy = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").copy("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").copy("*"),
|
||||
},
|
||||
paste = {
|
||||
["+"] = require("vim.ui.clipboard.osc52").paste("+"),
|
||||
["*"] = require("vim.ui.clipboard.osc52").paste("*"),
|
||||
},
|
||||
}
|
||||
|
||||
-- Enable mouse mode
|
||||
vim.o.mouse = 'a'
|
||||
vim.o.mouse = "a"
|
||||
|
||||
-- Enable break indent
|
||||
vim.o.breakindent = true
|
||||
@@ -33,13 +45,13 @@ vim.o.splitright = true
|
||||
vim.o.splitbelow = true
|
||||
|
||||
-- Add a gutter so that things don't jump around
|
||||
vim.wo.signcolumn = 'yes'
|
||||
vim.wo.signcolumn = "yes"
|
||||
|
||||
-- Prevent markdown from collapsing down
|
||||
vim.o.foldenable = false
|
||||
|
||||
-- Preview substitutions live, as you type!
|
||||
vim.o.inccommand = 'split'
|
||||
vim.o.inccommand = "split"
|
||||
|
||||
-- Show which line your cursor is on
|
||||
vim.o.cursorline = true
|
||||
@@ -53,7 +65,7 @@ vim.o.tabstop = 2
|
||||
vim.o.shiftwidth = 2
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noinsert,noselect'
|
||||
vim.o.completeopt = "menuone,noinsert,noselect"
|
||||
|
||||
-- Disable modelines, this removes some errors when opening text files
|
||||
vim.o.modeline = false
|
||||
|
||||
Reference in New Issue
Block a user