diff --git a/init.lua b/init.lua index b98ffc6198a..4c8a9b39960 100644 --- a/init.lua +++ b/init.lua @@ -91,7 +91,7 @@ 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.o` @@ -102,7 +102,7 @@ vim.g.have_nerd_font = false vim.o.number = true -- You can also add relative line numbers, to help with jumping. -- Experiment for yourself to see if you like it! --- vim.o.relativenumber = true +vim.o.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -120,7 +120,6 @@ end) -- Enable break indent vim.o.breakindent = true - -- Save undo history vim.o.undofile = true @@ -136,7 +135,6 @@ vim.o.updatetime = 250 -- Decrease mapped sequence wait time vim.o.timeoutlen = 300 - -- Configure how new splits should be opened vim.o.splitright = true vim.o.splitbelow = true @@ -172,7 +170,6 @@ vim.o.confirm = true -- Clear highlights on search when pressing in normal mode -- See `:help hlsearch` vim.keymap.set('n', '', 'nohlsearch') - -- Diagnostic keymaps vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) @@ -205,6 +202,8 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the upper win -- vim.keymap.set("n", "", "J", { desc = "Move window to the lower" }) -- vim.keymap.set("n", "", "K", { desc = "Move window to the upper" }) +vim.keymap.set('n', '', 'Neotree toggle', { desc = 'Toggle Neotree' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -462,7 +461,7 @@ require('lazy').setup({ end, }, - -- LSP Plugins + -- SP Plugins { -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins -- used for completion, annotations and signatures of Neovim apis @@ -475,6 +474,29 @@ require('lazy').setup({ }, }, }, + + -- Tpescript-tools plugin + + { + 'pmizio/typescript-tools.nvim', + dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + config = function() + require('typescript-tools').setup { + settings = { + tsserver_file_preferences = { + includeInlayParameterNameHints = 'all', + includeCompletionsForModuleExports = true, + quotePreference = 'auto', + }, + tsserver_format_options = { + allowIncompleteCompletions = false, + allowRenameOfImportPath = true, + }, + }, + } + end, + }, + { -- Main LSP Configuration 'neovim/nvim-lspconfig', @@ -674,7 +696,7 @@ require('lazy').setup({ -- clangd = {}, -- 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: @@ -736,6 +758,30 @@ require('lazy').setup({ end, }, + -- Windsurf (Codium) + + { + 'Exafunction/windsurf.nvim', + dependencies = { + 'nvim-lua/plenary.nvim', + 'hrsh7th/nvim-cmp', + }, + config = function() + require('codeium').setup { + workspace_root = { + use_lsp = true, + find_root = nil, + paths = { + '.git', + 'package.json', + }, + }, + virtual_text = { + enabled = true, + }, + } + end, + }, { -- Autoformat 'stevearc/conform.nvim', event = { 'BufWritePre' }, @@ -771,8 +817,9 @@ require('lazy').setup({ -- Conform can also run multiple formatters sequentially -- python = { "isort", "black" }, -- - -- You can use 'stop_after_first' to run the first available formatter from the list - -- javascript = { "prettierd", "prettier", stop_after_first = true }, + -- You can use '' to run the first available formatter from the list + javascript = { 'prettierd', 'prettier', stop_after_first = true }, + typescript = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, @@ -876,25 +923,16 @@ require('lazy').setup({ }, }, - { -- You can easily change to a different colorscheme. - -- Change the name of the colorscheme plugin below, and then - -- change the command in the config to whatever the name of that colorscheme is. - -- - -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. - 'folke/tokyonight.nvim', - priority = 1000, -- Make sure to load this before all the other start plugins. + -- Theme + { + 'catppuccin/nvim', + name = 'catppuccin', + priority = 1000, config = function() - ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, + require('catppuccin').setup { + flavour = 'mocha', -- latte, frappe, macchiato, mocha } - - -- Load the colorscheme here. - -- Like many other themes, this one has different styles, and you could load - -- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'. - vim.cmd.colorscheme 'tokyonight-night' + vim.cmd.colorscheme 'catppuccin' end, }, @@ -963,7 +1001,34 @@ require('lazy').setup({ -- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, - + { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', + 'MunifTanjim/nui.nvim', + }, + config = function() + require('neo-tree').setup { + filesystem = { + filtered_items = { + visible = true, + hide_dotfiles = false, + hide_gitignored = false, + }, + }, + } + end, + }, + -- ~/.config/nvim/lua/plugins/vim-visual-multi.lua + { + 'mg979/vim-visual-multi', + branch = 'master', + init = function() + -- Optional: customize keybindings + end, + }, -- The following comments only work if you have downloaded the kickstart repo, not just copy pasted the -- init.lua. If you want these files, they are in the repository, so you can just download them and -- place them in the correct locations. @@ -974,13 +1039,13 @@ 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.gitsigns', -- adds gitsigns recommend keymaps - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- 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. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.