diff --git a/init.lua b/init.lua index aff5250e..8719106c 100644 --- a/init.lua +++ b/init.lua @@ -99,7 +99,7 @@ do 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` @@ -110,7 +110,7 @@ do 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' @@ -393,7 +393,7 @@ do -- 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' -- Highlight todo, notes, etc in comments vim.pack.add { gh 'folke/todo-comments.nvim' } @@ -525,6 +525,7 @@ do -- Add Telescope-based LSP pickers when an LSP attaches to a buffer. -- If you later switch picker plugins, this is where to update these mappings. + --TODO: I should redo these mappings vim.api.nvim_create_autocmd('LspAttach', { group = vim.api.nvim_create_augroup('telescope-lsp-attach', { clear = true }), callback = function(event) @@ -967,17 +968,23 @@ do -- 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 -- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- require 'custom.plugins' + require 'custom.plugins' end +-- FIX: godot-server: should check if the server is already running first... +local gdprojectfilepath = vim.fn.getcwd() .. '/project.godot' +local isInGdDirectory = vim.fn.filereadable(gdprojectfilepath) == 1 + +if isInGdDirectory then vim.fn.serverstart '127.0.0.1:55432' end + -- The line beneath this is called `modeline`. See `:help modeline` -- vim: ts=2 sts=2 sw=2 et diff --git a/lua/custom/plugins/guttermarks.lua b/lua/custom/plugins/guttermarks.lua new file mode 100644 index 00000000..fbc79a63 --- /dev/null +++ b/lua/custom/plugins/guttermarks.lua @@ -0,0 +1,4 @@ +return { + 'dimtion/guttermarks.nvim', + event = { 'BufReadPost', 'BufNewFile', 'BufWritePre', 'FileType' }, +} diff --git a/lua/custom/plugins/mini.lua b/lua/custom/plugins/mini.lua new file mode 100644 index 00000000..bea310ba --- /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 status', { desc = 'Git status' }) + 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/remote-sshfs.lua b/lua/custom/plugins/remote-sshfs.lua new file mode 100644 index 00000000..dda4fd04 --- /dev/null +++ b/lua/custom/plugins/remote-sshfs.lua @@ -0,0 +1,10 @@ +return { + 'nosduco/remote-sshfs.nvim', + dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' }, + opts = {}, +} + +-- Usage: :RemoteSSHFSConnect @:/path/to/file +-- Sometimes you have to force close, and that causes permission failed on reconnect. +-- When that happens DO NOT DELETE THE DIRECTORY under .sshfd. That will delete everything that mountpoint is connected to *at the connection* +-- Instead safely unmount with `umount -l ~/.sshfd/[MOUNT_POINT]` 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', +}