From 7781b2c9ee4e452f7c76becdeabfffaadec9fbca Mon Sep 17 00:00:00 2001 From: jjwoz Date: Mon, 25 Mar 2024 12:48:50 -0400 Subject: [PATCH] adding new features and stuff --- init.lua | 39 ++++++++++++++++++++++++++++---- lua/custom/plugins/autopairs.lua | 12 ++++++++++ lua/custom/plugins/filetree.lua | 13 +++++++++++ 3 files changed, 60 insertions(+), 4 deletions(-) create mode 100644 lua/custom/plugins/autopairs.lua create mode 100644 lua/custom/plugins/filetree.lua diff --git a/init.lua b/init.lua index 506bbaf5..f9f572c4 100644 --- a/init.lua +++ b/init.lua @@ -157,6 +157,10 @@ vim.opt.scrolloff = 10 -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` +vim.keymap.set('i', 'jk', '') +-- Neotree bindings +vim.keymap.set('n', '', ' Neotree toggle') + -- Set highlight on search, but clear on pressing in normal mode vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') @@ -167,6 +171,8 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagn vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) +-- + -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- for people to discover. Otherwise, you normally need to press , which -- is not what someone will guess without a bit more experience. @@ -540,7 +546,7 @@ require('lazy').setup({ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ local servers = { -- clangd = {}, - -- gopls = {}, + gopls = {}, -- pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs @@ -549,7 +555,32 @@ require('lazy').setup({ -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`tsserver`) will work just fine - -- tsserver = {}, + tsserver = { + settings = { + typescript = { + inlayHints = { + includeInlayParameterNameHints = 'literal', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = false, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = false, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, + }, -- lua_ls = { @@ -815,7 +846,7 @@ require('lazy').setup({ -- with nvim-treesitter. You should go explore a few and see what interests you: -- -- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod` - -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context + -- - Show your current context: https://g,ithub.com/nvim-treesitter/nvim-treesitter-context -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects end, }, @@ -837,7 +868,7 @@ require('lazy').setup({ -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, }, { ui = { -- If you have a Nerd Font, set icons to an empty table which will use the diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..529c3308 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,12 @@ +return { + 'windwp/nvim-autopairs', + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require('nvim-autopairs').setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require 'nvim-autopairs.completion.cmp' + local cmp = require 'cmp' + cmp.event:on('confirm_done', cmp_autopairs.on_confirm_done()) + end, +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua new file mode 100644 index 00000000..d9f923e4 --- /dev/null +++ b/lua/custom/plugins/filetree.lua @@ -0,0 +1,13 @@ +-- File: lua/custom/plugins/filetree.lua +return { + 'nvim-neo-tree/neo-tree.nvim', + version = '*', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + }, + config = function() + require('neo-tree').setup {} + end, +}