aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Matei Pintilie <lucafulger@gmail.com>2022-11-13 14:11:02 +0000
committerLuca Matei Pintilie <lucafulger@gmail.com>2022-11-13 14:11:02 +0000
commit8497608cef900bd8820195364acd9307dd8b3d4c (patch)
tree347881e334cfaede9ade21c6b005c67b7a0d8cf7
parent57dcd8648a80cf632d7295afa1e6e3912a8b2930 (diff)
downloaddotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.gz
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.bz2
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.lz
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.xz
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.tar.zst
dotfiles-8497608cef900bd8820195364acd9307dd8b3d4c.zip
Upgrade to neovim 0.8
-rw-r--r--.config/nvim/lua/keybinds.lua6
-rw-r--r--.config/nvim/lua/lsp.lua55
2 files changed, 54 insertions, 7 deletions
diff --git a/.config/nvim/lua/keybinds.lua b/.config/nvim/lua/keybinds.lua
index 8f2de84..3d4eac2 100644
--- a/.config/nvim/lua/keybinds.lua
+++ b/.config/nvim/lua/keybinds.lua
@@ -16,14 +16,14 @@ vim.api.nvim_command("vnoremap <A-k> :m '<-2<CR>gv=gv")
vim.keymap.set("n", "<Leader>n", nt_api.tree.toggle)
vim.keymap.set("n", "<Leader><CR>", vim.lsp.buf.code_action)
vim.keymap.set("n", "<Leader>K", vim.lsp.buf.hover)
-vim.keymap.set("n", "<Leader>D", vim.lsp.buf.definition)
-vim.keymap.set("n", "<Leader>R", vim.lsp.buf.references)
-vim.keymap.set("n", "<Leader>F", vim.lsp.buf.formatting)
+vim.keymap.set("n", "<Leader>F", vim.lsp.buf.format)
vim.keymap.set("n", "<Leader>d", vim.diagnostic.open_float)
vim.keymap.set("n", "<Leader>J", vim.lsp.buf.signature_help)
vim.keymap.set("n", "<Leader>f", telescope.find_files)
vim.keymap.set("n", "<Leader><TAB>", telescope.buffers)
+vim.keymap.set("n", "<Leader>D", telescope.lsp_definitions)
+vim.keymap.set("n", "<Leader>R", telescope.lsp_references)
vim.keymap.set("n", "<Leader>m", ":MinimapToggle<CR>")
vim.keymap.set("n", "<Leader>,", ":TroubleToggle<CR>")
diff --git a/.config/nvim/lua/lsp.lua b/.config/nvim/lua/lsp.lua
index 5610629..9f9253a 100644
--- a/.config/nvim/lua/lsp.lua
+++ b/.config/nvim/lua/lsp.lua
@@ -66,18 +66,53 @@ cmp.setup({
local on_attach = function(client, bufnr)
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
- local inlayhints = require("lsp-inlayhints")
- inlayhints.setup()
- inlayhints.on_attach(client, bufnr)
local lsp_signature = require("lsp_signature")
lsp_signature.on_attach({ bind = true }, bufnr)
+ require("lsp-inlayhints").setup()
+ require("lsp-inlayhints").on_attach(client, bufnr)
end
+vim.api.nvim_create_augroup("LspAttach_inlayhints", {})
+vim.api.nvim_create_autocmd("LspAttach", {
+ group = "LspAttach_inlayhints";
+ callback = function(args)
+ if not (args.data and args.data.client_id) then return end
+
+ local bufnr = args.buf
+ local client = vim.lsp.get_client_by_id(args.data.client_id)
+ require("lsp-inlayhints").on_attach(client, bufnr)
+ end;
+})
+
local lsputils = require("lspconfig").util
require("lspconfig").tsserver.setup({
on_attach = on_attach;
root_dir = lsputils.root_pattern("package.json", "tsconfig.json");
+ settings = {
+ typescript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all";
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true;
+ includeInlayFunctionParameterTypeHints = true;
+ includeInlayVariableTypeHints = true;
+ includeInlayPropertyDeclarationTypeHints = true;
+ includeInlayFunctionLikeReturnTypeHints = true;
+ includeInlayEnumMemberValueHints = true;
+ };
+ };
+ javascript = {
+ inlayHints = {
+ includeInlayParameterNameHints = "all";
+ includeInlayParameterNameHintsWhenArgumentMatchesName = true;
+ includeInlayFunctionParameterTypeHints = true;
+ includeInlayVariableTypeHints = true;
+ includeInlayPropertyDeclarationTypeHints = true;
+ includeInlayFunctionLikeReturnTypeHints = true;
+ includeInlayEnumMemberValueHints = true;
+ };
+ };
+ };
})
require("deno-nvim").setup({
@@ -85,7 +120,19 @@ require("deno-nvim").setup({
root_dir = vim.loop.cwd;
capabilities = capabilities;
on_attach = on_attach;
- settings = { enable = true; unstable = true; config = "./deno.jsonc" };
+ settings = {
+ deno = {
+ unstable = true;
+ inlayHints = {
+ enumMemberValues = { enabled = true };
+ functionLikeReturnTypes = { enabled = true };
+ parameterNames = { enabled = "all" };
+ parameterTypes = { enabled = true };
+ propertyDeclarationTypes = { enabled = true };
+ variableTypes = { enabled = true; suppressWhenTypeMatchesName = false };
+ };
+ };
+ };
};
});