diff --git a/init.lua b/init.lua index e429a663a4..05ef483bf5 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 -vim.g.have_nerd_font = false +vim.g.have_nerd_font = true -- [[ Setting options ]] require 'options' diff --git a/lua/carnifx/plugins/neo-tree.lua b/lua/carnifx/plugins/neo-tree.lua new file mode 100644 index 0000000000..85b04151ef --- /dev/null +++ b/lua/carnifx/plugins/neo-tree.lua @@ -0,0 +1,24 @@ +return { + 'nvim-neo-tree/neo-tree.nvim', + branch = 'v3.x', + dependencies = { + 'nvim-lua/plenary.nvim', + 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + 'MunifTanjim/nui.nvim', + -- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information + }, + config = function() + require('neo-tree').setup { + window = { + position = 'right', + width = 40, + }, + filesystem = { + filtered_items = { + hide_dotfiles = false, + hide_gitignored = false, + }, + }, + } + end, +} diff --git a/lua/kickstart/plugins/telescope.lua b/lua/carnifx/plugins/telescope.lua similarity index 100% rename from lua/kickstart/plugins/telescope.lua rename to lua/carnifx/plugins/telescope.lua diff --git a/lua/carnifx/plugins/typescript-tools.lua b/lua/carnifx/plugins/typescript-tools.lua new file mode 100644 index 0000000000..ba7fb2046e --- /dev/null +++ b/lua/carnifx/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/keymaps.lua b/lua/keymaps.lua index c6c87b15dc..6f99dd2ba1 100644 --- a/lua/keymaps.lua +++ b/lua/keymaps.lua @@ -5,6 +5,12 @@ vim.opt.hlsearch = true vim.keymap.set('n', '', 'nohlsearch') +-- exit insert mode +vim.keymap.set('i', 'jk', '') + +-- Shoutcut to save file (ZZ saves and exits, ZQ exists without saving, so ZW makes sense to save without exiting) +vim.keymap.set('n', 'ZW', ':w', { desc = 'Save file' }) + -- Diagnostic keymaps vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) @@ -34,6 +40,10 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Neo-tree Keybinds +vim.keymap.set('n', 'no', ':Neotree', { desc = 'Open Neotree' }) +vim.keymap.set('n', 'nc', ':Neotree close right', { desc = 'Close Neotree' }) + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` diff --git a/lua/kickstart/plugins/which-key.lua b/lua/kickstart/plugins/which-key.lua index d66449ebf1..6320d0f315 100644 --- a/lua/kickstart/plugins/which-key.lua +++ b/lua/kickstart/plugins/which-key.lua @@ -27,6 +27,7 @@ return { ['r'] = { name = '[R]ename', _ = 'which_key_ignore' }, ['s'] = { name = '[S]earch', _ = 'which_key_ignore' }, ['w'] = { name = '[W]orkspace', _ = 'which_key_ignore' }, + ['n'] = { name = '[N]eotree', _ = 'which_key_ignore' }, } end, }, diff --git a/lua/lazy-plugins.lua b/lua/lazy-plugins.lua index 5cd5b24884..2ca4d7fa64 100644 --- a/lua/lazy-plugins.lua +++ b/lua/lazy-plugins.lua @@ -8,11 +8,16 @@ -- To update plugins you can run -- :Lazy update -- +-- +-- At some point, move to automatically configuring plugins based on the directory +-- supplied to the "setup" argument +-- require('lazy').setup("carnifx.plugins", {}) +-- for more info see: https://github.com/garcia5/dotfiles/blob/master/files/nvim/init.lua#L26-L32 -- NOTE: Here is where you install your plugins. require('lazy').setup({ -- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link). - 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically + 'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically -- NOTE: Plugins can also be added by using a table, -- with the first argument being the link and the following -- keys can be used to configure plugin behavior/loading/etc. @@ -32,8 +37,6 @@ require('lazy').setup({ require 'kickstart/plugins/which-key', - require 'kickstart/plugins/telescope', - require 'kickstart/plugins/lspconfig', require 'kickstart/plugins/conform', @@ -48,6 +51,11 @@ require('lazy').setup({ require 'kickstart/plugins/treesitter', + require 'carnifx/plugins/neo-tree', + + require 'carnifx/plugins/telescope', + + require 'carnifx/plugins/typescript-tools', -- The following two 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. diff --git a/lua/options.lua b/lua/options.lua index c97d75feb0..44ebb8cd02 100644 --- a/lua/options.lua +++ b/lua/options.lua @@ -5,9 +5,8 @@ -- Make line numbers default vim.opt.number = true --- You can also add relative line numbers, to help with jumping. --- Experiment for yourself to see if you like it! --- vim.opt.relativenumber = true + +vim.opt.relativenumber = true -- Enable mouse mode, can be useful for resizing splits for example! vim.opt.mouse = 'a'