diff --git a/init.lua b/init.lua index 5cac3d14..fad32295 100644 --- a/init.lua +++ b/init.lua @@ -87,11 +87,11 @@ P.S. You can delete this when you're done too. It's your config now! :) -- Set as the leader key -- See `:help mapleader` -- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used) -vim.g.mapleader = ' ' -vim.g.maplocalleader = ' ' +vim.g.mapleader = ';' +vim.g.maplocalleader = ';' -- Set to true if you have a Nerd Font installed and selected in the terminal -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] -- See `:help vim.opt` @@ -110,6 +110,9 @@ vim.opt.mouse = 'a' -- Don't show the mode, since it's already in the status line vim.opt.showmode = false +-- Disable swapfiles +vim.opt.swapfile = false -- Disable .swp files + -- Sync clipboard between OS and Neovim. -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. @@ -189,6 +192,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Custom Keybinds. +vim.keymap.set('i', 'jk', '', { desc = 'escape' }) +vim.keymap.set('i', 'kj', '', { desc = 'escape' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -659,9 +666,9 @@ 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 = {}, + rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -670,7 +677,65 @@ require('lazy').setup({ -- But for many setups, the LSP (`ts_ls`) will work just fine -- ts_ls = {}, -- - + -- Vue 3 + volar = { + init_options = { + vue = { + hybridMode = false, + }, + }, + settings = { + typescript = { + inlayHints = { + enumMemberValues = { + enabled = true, + }, + functionLikeReturnTypes = { + enabled = true, + }, + propertyDeclarationTypes = { + enabled = true, + }, + parameterTypes = { + enabled = true, + suppressWhenArgumentMatchesName = true, + }, + variableTypes = { + enabled = true, + }, + }, + }, + }, + }, + -- TypeScript + ts_ls = { + init_options = { + plugins = { + { + name = '@vue/typescript-plugin', + location = vim.fn.stdpath 'data' .. '/mason/packages/vue-language-server/node_modules/@vue/language-server', + languages = { 'vue' }, + }, + }, + }, + settings = { + typescript = { + tsserver = { + useSyntaxServer = false, + }, + inlayHints = { + includeInlayParameterNameHints = 'all', + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, + }, lua_ls = { -- cmd = { ... }, -- filetypes = { ... }, @@ -685,6 +750,9 @@ require('lazy').setup({ }, }, }, + + -- python lsp + pyright = {}, } -- Ensure the servers and tools above are installed @@ -838,7 +906,7 @@ require('lazy').setup({ -- If you prefer more traditional completion keymaps, -- you can uncomment the following lines - --[''] = cmp.mapping.confirm { select = true }, + [''] = cmp.mapping.confirm { select = true }, --[''] = cmp.mapping.select_next_item(), --[''] = cmp.mapping.select_prev_item(), @@ -982,11 +1050,11 @@ require('lazy').setup({ -- Uncomment any of the lines below to enable them (you will need to restart nvim). -- -- require 'kickstart.plugins.debug', - -- require 'kickstart.plugins.indent_line', - -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', - -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps + require 'kickstart.plugins.indent_line', + require 'kickstart.plugins.lint', + require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.neo-tree', + require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- This is the easiest way to modularize your config.