Skip to content

Commit 7b59959

Browse files
committed
ts extra tooling / messing with autocomplete (it was alacritty fault)
1 parent 79c75bc commit 7b59959

File tree

2 files changed

+66
-9
lines changed

2 files changed

+66
-9
lines changed

init.lua

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,10 @@ vim.opt.cursorline = true
160160
-- Minimal number of screen lines to keep above and below the cursor.
161161
vim.opt.scrolloff = 15
162162

163-
-- Tabstop 8 by default, 4 looks better in my opinion
164-
vim.opt.tabstop = 4
163+
-- Tabstop in any other number that is not 8 makes documents look weird, will try with using other opts
164+
vim.opt.tabstop = 8
165+
vim.opt.softtabstop = 4
166+
vim.opt.shiftwidth = 4
165167

166168
-- [[ Basic Keymaps ]]
167169
-- See `:help vim.keymap.set()`
@@ -329,7 +331,7 @@ require('lazy').setup {
329331
-- Useful for getting pretty icons, but requires special font.
330332
-- If you already have a Nerd Font, or terminal set up with fallback fonts
331333
-- you can enable this
332-
-- { 'nvim-tree/nvim-web-devicons' }
334+
{ 'nvim-tree/nvim-web-devicons' },
333335
},
334336
config = function()
335337
-- Telescope is a fuzzy finder that comes with a lot of different things that
@@ -555,7 +557,7 @@ require('lazy').setup {
555557
-- https://github.com/pmizio/typescript-tools.nvim
556558
--
557559
-- But for many setups, the LSP (`tsserver`) will work just fine
558-
-- tsserver = {},
560+
tsserver = {},
559561
--
560562

561563
lua_ls = {
@@ -795,7 +797,7 @@ require('lazy').setup {
795797

796798
---@diagnostic disable-next-line: missing-fields
797799
require('nvim-treesitter.configs').setup {
798-
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc' },
800+
ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'javascript', 'typescript' },
799801
-- Autoinstall languages that are not installed
800802
auto_install = true,
801803
highlight = { enable = true },

lua/custom/plugins/init.lua

Lines changed: 59 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,63 @@
33
--
44
-- See the kickstart.nvim README for more information
55
return {
6-
'morhetz/gruvbox',
7-
config = function()
8-
vim.cmd.colorscheme 'gruvbox'
9-
end,
6+
{
7+
'morhetz/gruvbox',
8+
config = function()
9+
vim.cmd.colorscheme 'gruvbox'
10+
end,
11+
},
12+
{
13+
'pmizio/typescript-tools.nvim',
14+
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
15+
opts = {},
16+
config = function()
17+
require('typescript-tools').setup {
18+
19+
settings = {
20+
-- spawn additional tsserver instance to calculate diagnostics on it
21+
separate_diagnostic_server = true,
22+
-- "change"|"insert_leave" determine when the client asks the server about diagnostic
23+
publish_diagnostic_on = 'insert_leave',
24+
-- array of strings("fix_all"|"add_missing_imports"|"remove_unused"|
25+
-- "remove_unused_imports"|"organize_imports") -- or string "all"
26+
-- to include all supported code actions
27+
-- specify commands exposed as code_actions
28+
expose_as_code_action = {},
29+
-- string|nil - specify a custom path to `tsserver.js` file, if this is nil or file under path
30+
-- not exists then standard path resolution strategy is applied
31+
tsserver_path = nil,
32+
-- specify a list of plugins to load by tsserver, e.g., for support `styled-components`
33+
-- (see ?? `styled-components` support section)
34+
tsserver_plugins = {},
35+
-- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
36+
-- memory limit in megabytes or "auto"(basically no limit)
37+
tsserver_max_memory = 'auto',
38+
-- described below
39+
tsserver_format_options = {},
40+
tsserver_file_preferences = {},
41+
-- locale of all tsserver messages, supported locales you can find here:
42+
-- https://github.com/microsoft/TypeScript/blob/3c221fc086be52b19801f6e8d82596d04607ede6/src/compiler/utilitiesPublic.ts#L620
43+
tsserver_locale = 'en',
44+
-- mirror of VSCode's `typescript.suggest.completeFunctionCalls`
45+
complete_function_calls = false,
46+
include_completions_with_insert_text = true,
47+
-- CodeLens
48+
-- WARNING: Experimental feature also in VSCode, because it might hit performance of server.
49+
-- possible values: ("off"|"all"|"implementations_only"|"references_only")
50+
code_lens = 'off',
51+
-- by default code lenses are displayed on all referencable values and for some of you it can
52+
-- be too much this option reduce count of them by removing member references from lenses
53+
disable_member_code_lens = true,
54+
-- JSXCloseTag
55+
-- WARNING: it is disabled by default (maybe you configuration or distro already uses nvim-ts-autotag,
56+
-- that maybe have a conflict if enable this feature. )
57+
jsx_close_tag = {
58+
enable = false,
59+
filetypes = { 'javascriptreact', 'typescriptreact' },
60+
},
61+
},
62+
}
63+
end,
64+
},
1065
}

0 commit comments

Comments
 (0)