diff --git a/init.lua b/init.lua index ed50b69d..51af4b56 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' @@ -198,10 +198,10 @@ vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagn vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) -- TIP: Disable arrow keys in normal mode --- vim.keymap.set('n', '', 'echo "Use h to move!!"') --- vim.keymap.set('n', '', 'echo "Use l to move!!"') --- vim.keymap.set('n', '', 'echo "Use k to move!!"') --- vim.keymap.set('n', '', 'echo "Use j to move!!"') +vim.keymap.set('n', '', 'echo "Use h to move!!"') +vim.keymap.set('n', '', 'echo "Use l to move!!"') +vim.keymap.set('n', '', 'echo "Use k to move!!"') +vim.keymap.set('n', '', 'echo "Use j to move!!"') -- Keybinds to make split navigation easier. -- Use CTRL+ to switch between windows @@ -320,6 +320,8 @@ require('lazy').setup({ { 't', group = '[T]oggle' }, { 'h', group = 'Git [H]unk', mode = { 'n', 'v' } }, -- Enable gitsigns recommended keymaps first { 'gr', group = 'LSP Actions', mode = { 'n' } }, + { 'g', group = '[G]it' }, + { 'n', group = '[N]otepad' }, }, }, }, @@ -401,6 +403,7 @@ require('lazy').setup({ -- Enable Telescope extensions if they are installed pcall(require('telescope').load_extension, 'fzf') + --TODO: need to install the telescope ui-select plugin? pcall(require('telescope').load_extension, 'ui-select') -- See `:help telescope.builtin` @@ -600,9 +603,9 @@ require('lazy').setup({ -- See `:help lsp-config` for information about keys and how to configure ---@type table local servers = { - -- clangd = {}, + clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- -- Some languages (like typescript) have entire language plugins that can be useful: @@ -653,6 +656,7 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { -- You can add other tools here that you want Mason to install + 'omnisharp', -- C# Language Server }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -700,7 +704,9 @@ 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', 'prettier', stop_after_first = true }, + typescript = { 'prettierd', 'prettier', stop_after_first = true }, + typescriptreact = { 'prettierd', 'prettier', stop_after_first = true }, }, }, }, @@ -724,6 +730,7 @@ require('lazy').setup({ dependencies = { -- `friendly-snippets` contains a variety of premade snippets. -- See the README about individual language/framework/plugin snippets: + -- TODO: look into friendly-snippets -- https://github.com/rafamadriz/friendly-snippets -- { -- 'rafamadriz/friendly-snippets', @@ -791,13 +798,16 @@ require('lazy').setup({ -- the rust implementation via `'prefer_rust_with_warning'` -- -- See :h blink-cmp-config-fuzzy for more information - fuzzy = { implementation = 'lua' }, + fuzzy = { implementation = 'prefer_rust_with_warning' }, -- Shows a signature help window while you type arguments for a function signature = { enabled = true }, }, }, + -- THEMES + { 'catppuccin/nvim', name = 'catppuccin', priority = 1000 }, + { 'rose-pine/neovim', name = 'rose-pine', priority = 1000 }, { -- 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. @@ -816,7 +826,7 @@ require('lazy').setup({ -- 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 'rose-pine' end, }, @@ -831,42 +841,6 @@ require('lazy').setup({ opts = { signs = false }, }, - { -- Collection of various small independent plugins/modules - 'nvim-mini/mini.nvim', - config = function() - -- Better Around/Inside textobjects - -- - -- Examples: - -- - va) - [V]isually select [A]round [)]paren - -- - yinq - [Y]ank [I]nside [N]ext [Q]uote - -- - ci' - [C]hange [I]nside [']quote - require('mini.ai').setup { n_lines = 500 } - - -- Add/delete/replace surroundings (brackets, quotes, etc.) - -- - -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren - -- - sd' - [S]urround [D]elete [']quotes - -- - sr)' - [S]urround [R]eplace [)] ['] - require('mini.surround').setup() - - -- Simple and easy statusline. - -- You could remove this setup call if you don't like it, - -- and try some other statusline plugin - local statusline = require 'mini.statusline' - -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } - - -- You can configure sections in the statusline by overriding their - -- default behavior. For example, here we set the section for - -- cursor location to LINE:COLUMN - ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() return '%2l:%-2v' end - - -- ... and there is more! - -- Check out: https://github.com/nvim-mini/mini.nvim - end, - }, - { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', lazy = false, @@ -910,9 +884,9 @@ 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.indent_line', -- require 'kickstart.plugins.lint', - -- require 'kickstart.plugins.autopairs', + require 'kickstart.plugins.autopairs', -- require 'kickstart.plugins.neo-tree', -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps @@ -920,7 +894,7 @@ require('lazy').setup({ -- 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/lua/custom/plugins/mini.lua b/lua/custom/plugins/mini.lua new file mode 100644 index 00000000..d7f197ca --- /dev/null +++ b/lua/custom/plugins/mini.lua @@ -0,0 +1,32 @@ +return { + 'nvim-mini/mini.nvim', + config = function() + -- Better Around/Inside textobjects + -- + -- Examples: + -- - va) - [V]isually select [A]round [)]paren + -- - yinq - [Y]ank [I]nside [N]ext [Q]uote + -- - ci' - [C]hange [I]nside [']quote + require('mini.ai').setup { n_lines = 500 } + + -- Add/delete/replace surroundings (brackets, quotes, etc.) + -- + -- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren + -- - sd' - [S]urround [D]elete [']quotes + -- - sr)' - [S]urround [R]eplace [)] ['] + require('mini.surround').setup() + + require('mini.move').setup() + require('mini.git').setup() + + local statusline = require 'mini.statusline' + statusline.setup { use_icons = vim.g.have_nerd_font } + ---@diagnostic disable-next-line: duplicate-set-field + statusline.section_location = function() return '%2l:%-2v' end + + vim.keymap.set('n', 'ga', 'Git add -A', { desc = 'Git add all' }) + vim.keymap.set('n', 'gc', 'Git commit', { desc = 'Git commit' }) + vim.keymap.set('n', 'gs', 'Git stash', { desc = 'Git stash' }) + vim.keymap.set('n', 'gg', 'Git log --graph --oneline --all', { desc = 'Git graph' }) + end, +} diff --git a/lua/custom/plugins/oil.lua b/lua/custom/plugins/oil.lua new file mode 100644 index 00000000..66018eb6 --- /dev/null +++ b/lua/custom/plugins/oil.lua @@ -0,0 +1,7 @@ +return { + 'stevearc/oil.nvim', + config = function() + require('oil').setup() + vim.keymap.set('n', '-', 'Oil', { desc = 'Open parent directory' }) + end, +} diff --git a/lua/custom/plugins/snacks.lua b/lua/custom/plugins/snacks.lua new file mode 100644 index 00000000..8144c975 --- /dev/null +++ b/lua/custom/plugins/snacks.lua @@ -0,0 +1,24 @@ +return { + 'folke/snacks.nvim', + priority = 1000, + lazy = false, + ---@type snacks.Config + opts = { + --TODO: Use this for a bit and compare to mini dashboard + --TODO: design a style and featuers for my dashboard (add opening parent directory with Oil) + dashboard = { enabled = true }, + gitbrowse = { enabled = true }, + lazygit = { enabled = true }, + --TODO: determine a method for deleting scratches easily + scratch = { enabled = true }, + terminal = { enabled = true }, + }, + keys = { + { '=', function() Snacks.dashboard.open() end, desc = 'Dashboard' }, + { 'gb', function() Snacks.gitbrowse.open() end, desc = 'Open Git Repository in Browser' }, + { 'gl', function() Snacks.lazygit.open() end, desc = 'Open Lazy Git' }, + { 'no', function() Snacks.scratch() end, desc = 'Open Notepad' }, + { 'ns', function() Snacks.scratch.select() end, desc = 'Select Note' }, + { '', function() Snacks.terminal() end, desc = 'Open Terminal' }, + }, +} diff --git a/lua/custom/plugins/typescript-tools.lua b/lua/custom/plugins/typescript-tools.lua new file mode 100644 index 00000000..ba7fb204 --- /dev/null +++ b/lua/custom/plugins/typescript-tools.lua @@ -0,0 +1,5 @@ +return { + 'pmizio/typescript-tools.nvim', + dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' }, + opts = {}, +} diff --git a/lua/custom/plugins/vimtmuxnavigator.lua b/lua/custom/plugins/vimtmuxnavigator.lua new file mode 100644 index 00000000..d4aaccb2 --- /dev/null +++ b/lua/custom/plugins/vimtmuxnavigator.lua @@ -0,0 +1,3 @@ +return { + 'christoomey/vim-tmux-navigator', +}