diff --git a/.gitignore b/.gitignore index 005b535b606..8a192cab54d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ test.sh nvim spell/ -lazy-lock.json diff --git a/init.lua b/init.lua index b98ffc6198a..c6d68965574 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.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.o.mouse = 'a' @@ -114,9 +114,9 @@ vim.o.showmode = false -- Schedule the setting after `UiEnter` because it can increase startup-time. -- Remove this option if you want your OS clipboard to remain independent. -- See `:help 'clipboard'` -vim.schedule(function() - vim.o.clipboard = 'unnamedplus' -end) +-- vim.schedule(function() +-- vim.opt.clipboard = 'unnamedplus' +-- end) -- Enable break indent vim.o.breakindent = true @@ -166,6 +166,12 @@ vim.o.scrolloff = 10 -- See `:help 'confirm'` vim.o.confirm = true +vim.opt.colorcolumn = '80' + +vim.diagnostic.config { + virtual_text = true, +} + -- [[ Basic Keymaps ]] -- See `:help vim.keymap.set()` @@ -205,6 +211,31 @@ 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" }) +-- [[ Custom Keymaps ]] +vim.keymap.set('n', 'p', vim.cmd.Ex, { desc = 'File explorer' }) + +vim.keymap.set('v', 'J', ":m '>+1gv=gv", { desc = 'Move text down' }) +vim.keymap.set('v', 'K', ":m '<-2gv=gv", { desc = 'Move text up' }) + +vim.keymap.set('n', '', 'zz') +vim.keymap.set('n', '', 'zz') + +vim.keymap.set('n', 'n', 'nzz') +vim.keymap.set('n', 'N', 'Nzz') + +vim.keymap.set('n', 'J', '5j') +vim.keymap.set('n', 'K', '5k') + +vim.keymap.set('n', 'gh', vim.lsp.buf.hover, { desc = 'Hover documentation' }) + +vim.keymap.set('n', 'J', 'mzJ`z', { desc = 'Keep cursor position and join lines' }) + +vim.keymap.set('n', 'y', '"+y', { desc = 'Yank to system clipboard' }) +vim.keymap.set('v', 'y', '"+y', { desc = 'Yank selection to system clipboard' }) +vim.keymap.set('n', 'Y', '"+y$', { desc = 'Yank until end of line to system clipboard' }) + +vim.keymap.set('n', '', '') + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -407,12 +438,19 @@ require('lazy').setup({ -- You can put your default mappings / updates / etc. in here -- All the info you're looking for is in `:help telescope.setup()` -- - -- defaults = { - -- mappings = { - -- i = { [''] = 'to_fuzzy_refine' }, - -- }, - -- }, - -- pickers = {} + defaults = { + mappings = { + i = { + [''] = require('telescope.actions').delete_buffer, + }, + n = { + [''] = require('telescope.actions').delete_buffer, + }, + }, + }, + pickers = { + colorscheme = { enable_preview = true }, + }, extensions = { ['ui-select'] = { require('telescope.themes').get_dropdown(), @@ -435,7 +473,7 @@ require('lazy').setup({ vim.keymap.set('n', 'sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', 's.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) - vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Find existing buffers' }) + vim.keymap.set('n', '', builtin.buffers, { desc = '[ ] Search existing buffers' }) -- Slightly advanced example of overriding default behavior and theme vim.keymap.set('n', '/', function() @@ -672,17 +710,37 @@ 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 - -- + -- Some languages (like typescript) have entire language plugins that can be useful: -- https://github.com/pmizio/typescript-tools.nvim -- -- But for many setups, the LSP (`ts_ls`) will work just fine - -- ts_ls = {}, - -- + ts_ls = { + cmd = { 'tsgo' }, + + filetypes = { + 'javascript', + 'typescript', + 'javascriptreact', + 'typescriptreact', + }, + }, + + prettierd = {}, + + eslint_d = {}, + + volar = { + init_options = { + vue = { + hybridMode = false, + }, + }, + }, lua_ls = { -- cmd = { ... }, @@ -772,7 +830,12 @@ require('lazy').setup({ -- 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 }, + javascript = { 'prettierd', 'eslint_d', stop_after_first = true }, + typescript = { 'prettierd', 'eslint_d', stop_after_first = true }, + vue = { 'prettierd', 'eslint_d', stop_after_first = true }, + json = { 'prettierd' }, + html = { 'prettierd' }, + css = { 'prettierd' }, }, }, }, @@ -881,20 +944,25 @@ require('lazy').setup({ -- 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', + 'catppuccin/nvim', + name = 'catppuccin', priority = 1000, -- Make sure to load this before all the other start plugins. config = function() ---@diagnostic disable-next-line: missing-fields - require('tokyonight').setup { - styles = { - comments = { italic = false }, -- Disable italics in comments - }, - } + -- require('tokyonight').setup { + -- styles = { + -- comments = { italic = false }, -- Disable italics in comments + -- }, + -- } -- 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 'tokyonight-night' + vim.cmd.colorscheme 'catppuccin-mocha' + + -- You can configure highlights by doing something like: + vim.cmd.hi 'Comment gui=none' end, }, @@ -977,14 +1045,14 @@ require('lazy').setup({ -- require 'kickstart.plugins.indent_line', -- require 'kickstart.plugins.lint', -- require 'kickstart.plugins.autopairs', - -- require 'kickstart.plugins.neo-tree', + 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. -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- { import = 'custom.plugins' }, + { import = 'custom.plugins' }, -- -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec` -- Or use telescope! diff --git a/lazy-lock.json b/lazy-lock.json new file mode 100644 index 00000000000..7746823f494 --- /dev/null +++ b/lazy-lock.json @@ -0,0 +1,29 @@ +{ + "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" }, + "blink.cmp": { "branch": "main", "commit": "b19413d214068f316c78978b08264ed1c41830ec" }, + "catppuccin": { "branch": "main", "commit": "beaf41a30c26fd7d6c386d383155cbd65dd554cd" }, + "conform.nvim": { "branch": "master", "commit": "c2526f1cde528a66e086ab1668e996d162c75f4f" }, + "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" }, + "gitsigns.nvim": { "branch": "main", "commit": "abf82a65f185bd54adc0679f74b7d6e1ada690c9" }, + "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" }, + "lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" }, + "lazydev.nvim": { "branch": "main", "commit": "5231c62aa83c2f8dc8e7ba957aa77098cda1257d" }, + "mason-lspconfig.nvim": { "branch": "main", "commit": "3d89e7c92fbd96c5e10e0298fc2b006f21cf9428" }, + "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" }, + "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" }, + "mini.nvim": { "branch": "main", "commit": "9b935c218ddba02e5dc75c94f90143bce1f7c646" }, + "neo-tree.nvim": { "branch": "main", "commit": "f3df514fff2bdd4318127c40470984137f87b62e" }, + "nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" }, + "nvim-lspconfig": { "branch": "master", "commit": "5fef3b4a5f1057553b78d048322782c3a9ae69c6" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, + "nvim-treesitter-context": { "branch": "master", "commit": "64dd4cf3f6fd0ab17622c5ce15c91fc539c3f24a" }, + "nvim-web-devicons": { "branch": "master", "commit": "803353450c374192393f5387b6a0176d0972b848" }, + "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" }, + "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" }, + "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" }, + "telescope.nvim": { "branch": "master", "commit": "ad7d9580338354ccc136e5b8f0aa4f880434dcdc" }, + "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" }, + "undotree": { "branch": "master", "commit": "178d19e00a643f825ea11d581b1684745d0c4eda" }, + "vim-fugitive": { "branch": "master", "commit": "61b51c09b7c9ce04e821f6cf76ea4f6f903e3cf4" }, + "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" } +} diff --git a/lua/custom/plugins/fugitive.lua b/lua/custom/plugins/fugitive.lua new file mode 100644 index 00000000000..b6b4c97bc32 --- /dev/null +++ b/lua/custom/plugins/fugitive.lua @@ -0,0 +1,3 @@ +return { + 'tpope/vim-fugitive', +} diff --git a/lua/custom/plugins/treesitter-context.lua b/lua/custom/plugins/treesitter-context.lua new file mode 100644 index 00000000000..66fa2c87000 --- /dev/null +++ b/lua/custom/plugins/treesitter-context.lua @@ -0,0 +1,6 @@ +return { + 'nvim-treesitter/nvim-treesitter-context', + config = function() + vim.api.nvim_set_hl(0, 'TreesitterContextBottom', { underline = false }) + end, +} diff --git a/lua/custom/plugins/undotree.lua b/lua/custom/plugins/undotree.lua new file mode 100644 index 00000000000..0ba2ed64f69 --- /dev/null +++ b/lua/custom/plugins/undotree.lua @@ -0,0 +1,9 @@ +return { + 'mbbill/undotree', + keys = { + { 'u', 'UndotreeToggle', desc = 'Toggle undotree' }, + }, + config = function() + vim.g.undotree_SetFocusWhenToggle = 1 + end, +} diff --git a/lua/kickstart/plugins/neo-tree.lua b/lua/kickstart/plugins/neo-tree.lua index c7067891df0..07faf83b891 100644 --- a/lua/kickstart/plugins/neo-tree.lua +++ b/lua/kickstart/plugins/neo-tree.lua @@ -13,7 +13,10 @@ return { keys = { { '\\', ':Neotree reveal', desc = 'NeoTree reveal', silent = true }, }, + ---@module "neo-tree" + ---@type neotree.Config? opts = { + auto_clean_after_session_restore = true, filesystem = { window = { mappings = {