From 464fc8ac81d4b2b59943f2cf866d7ed29ec86f35 Mon Sep 17 00:00:00 2001 From: Zach Drone Date: Sat, 30 Nov 2024 19:35:03 -0500 Subject: [PATCH 1/5] add some custom stuff --- init.lua | 20 ++++++++++++-------- lua/custom/keymaps.lua | 2 ++ lua/custom/options.lua | 6 ++++++ 3 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 lua/custom/keymaps.lua create mode 100644 lua/custom/options.lua diff --git a/init.lua b/init.lua index 08717d537e6..0128fb7c16d 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.opt` @@ -189,6 +189,7 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the left wind vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +vim.keymap.set('n', '', '', { desc = 'Close current split' }) -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -216,6 +217,9 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) +require 'custom.keymaps' +require 'custom.options' + -- [[ Configure and install plugins ]] -- -- To check the current status of your plugins, run @@ -617,7 +621,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, - -- pyright = {}, + pyright = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -928,17 +932,17 @@ 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. -- -- 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/keymaps.lua b/lua/custom/keymaps.lua new file mode 100644 index 00000000000..7914133934f --- /dev/null +++ b/lua/custom/keymaps.lua @@ -0,0 +1,2 @@ +vim.keymap.set('n', 'sv', 'v', { desc = 'Open verticle split' }) +vim.keymap.set('n', 'sh', 'h', { desc = 'Open horizontal split' }) diff --git a/lua/custom/options.lua b/lua/custom/options.lua new file mode 100644 index 00000000000..575305ff2fa --- /dev/null +++ b/lua/custom/options.lua @@ -0,0 +1,6 @@ +local opt = vim.opt + +opt.tabstop = 2 +opt.shiftwidth = 2 +opt.expandtab = true +opt.autoindent = true From 7ca0c57cf767dfaf1ca4b0e4c2db02c03b5ceadf Mon Sep 17 00:00:00 2001 From: Zach Drone Date: Sun, 1 Dec 2024 12:41:23 -0500 Subject: [PATCH 2/5] update --- init.lua | 12 +++++++----- lua/custom/keymaps.lua | 2 ++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/init.lua b/init.lua index 0128fb7c16d..467f70ee83c 100644 --- a/init.lua +++ b/init.lua @@ -217,9 +217,6 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then end ---@diagnostic disable-next-line: undefined-field vim.opt.rtp:prepend(lazypath) -require 'custom.keymaps' -require 'custom.options' - -- [[ Configure and install plugins ]] -- -- To check the current status of your plugins, run @@ -621,7 +618,7 @@ require('lazy').setup({ local servers = { -- clangd = {}, -- gopls = {}, - pyright = {}, + pylsp = {}, -- rust_analyzer = {}, -- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs -- @@ -661,6 +658,8 @@ require('lazy').setup({ local ensure_installed = vim.tbl_keys(servers or {}) vim.list_extend(ensure_installed, { 'stylua', -- Used to format Lua code + 'pylsp', + 'black', }) require('mason-tool-installer').setup { ensure_installed = ensure_installed } @@ -714,7 +713,7 @@ require('lazy').setup({ formatters_by_ft = { lua = { 'stylua' }, -- Conform can also run multiple formatters sequentially - -- python = { "isort", "black" }, + 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 }, @@ -970,5 +969,8 @@ require('lazy').setup({ }, }) +require 'custom.keymaps' +require 'custom.options' + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua index 7914133934f..30177eaa1e7 100644 --- a/lua/custom/keymaps.lua +++ b/lua/custom/keymaps.lua @@ -1,2 +1,4 @@ +local builtin = require 'telescope.builtin' vim.keymap.set('n', 'sv', 'v', { desc = 'Open verticle split' }) vim.keymap.set('n', 'sh', 'h', { desc = 'Open horizontal split' }) +vim.keymap.set('n', '', builtin.git_files, {}) From c80697b49d1d3405042527ad87d4b127e9f4fa50 Mon Sep 17 00:00:00 2001 From: Zach Drone Date: Tue, 3 Dec 2024 00:47:15 -0500 Subject: [PATCH 3/5] add jk --- lua/custom/keymaps.lua | 1 + lua/custom/options.lua | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lua/custom/keymaps.lua b/lua/custom/keymaps.lua index 30177eaa1e7..dd3bacb27fa 100644 --- a/lua/custom/keymaps.lua +++ b/lua/custom/keymaps.lua @@ -2,3 +2,4 @@ local builtin = require 'telescope.builtin' vim.keymap.set('n', 'sv', 'v', { desc = 'Open verticle split' }) vim.keymap.set('n', 'sh', 'h', { desc = 'Open horizontal split' }) vim.keymap.set('n', '', builtin.git_files, {}) +vim.keymap.set('i', 'jk', '') diff --git a/lua/custom/options.lua b/lua/custom/options.lua index 575305ff2fa..57f5e868e91 100644 --- a/lua/custom/options.lua +++ b/lua/custom/options.lua @@ -4,3 +4,7 @@ opt.tabstop = 2 opt.shiftwidth = 2 opt.expandtab = true opt.autoindent = true +opt.relativenumber = true +opt.number = true + +opt.wrap = false From 03401ccff7c2183d86b4ffe3bfb6b1e554f4df22 Mon Sep 17 00:00:00 2001 From: Zach Drone Date: Tue, 3 Dec 2024 01:04:50 -0500 Subject: [PATCH 4/5] add vim-fugitive --- lua/custom/plugins/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua index be0eb9d8d7a..abfaa91d067 100644 --- a/lua/custom/plugins/init.lua +++ b/lua/custom/plugins/init.lua @@ -2,4 +2,4 @@ -- I promise not to create any merge conflicts in this directory :) -- -- See the kickstart.nvim README for more information -return {} +return { 'tpope/vim-fugitive' } From 7d460fe5c02cace094d3e87457b0138f15c055dc Mon Sep 17 00:00:00 2001 From: Zach Drone Date: Fri, 6 Dec 2024 17:57:54 -0500 Subject: [PATCH 5/5] add tmux navigator and lazygit --- lua/custom/plugins/lazygit.lua | 19 +++++++++++++++++++ lua/custom/plugins/vim-tmux-navigator.lua | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 lua/custom/plugins/lazygit.lua create mode 100644 lua/custom/plugins/vim-tmux-navigator.lua diff --git a/lua/custom/plugins/lazygit.lua b/lua/custom/plugins/lazygit.lua new file mode 100644 index 00000000000..f779238aac2 --- /dev/null +++ b/lua/custom/plugins/lazygit.lua @@ -0,0 +1,19 @@ +return { + 'kdheepak/lazygit.nvim', + cmd = { + 'LazyGit', + 'LazyGitConfig', + 'LazyGitCurrentFile', + 'LazyGitFilter', + 'LazyGitFilterCurrentFile', + }, + -- optional for floating window border decoration + dependencies = { + 'nvim-lua/plenary.nvim', + }, + -- setting the keybinding for LazyGit with 'keys' is recommended in + -- order to load the plugin when the command is run for the first time + keys = { + { 'lg', 'LazyGit', desc = 'Open lazy git' }, + }, +} diff --git a/lua/custom/plugins/vim-tmux-navigator.lua b/lua/custom/plugins/vim-tmux-navigator.lua new file mode 100644 index 00000000000..588522631dc --- /dev/null +++ b/lua/custom/plugins/vim-tmux-navigator.lua @@ -0,0 +1,17 @@ +return { + 'christoomey/vim-tmux-navigator', + cmd = { + 'TmuxNavigateLeft', + 'TmuxNavigateDown', + 'TmuxNavigateUp', + 'TmuxNavigateRight', + 'TmuxNavigatePrevious', + }, + keys = { + { '', 'TmuxNavigateLeft' }, + { '', 'TmuxNavigateDown' }, + { '', 'TmuxNavigateUp' }, + { '', 'TmuxNavigateRight' }, + { '', 'TmuxNavigatePrevious' }, + }, +}