Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add neo-tree and typescript-tools #19

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
24 changes: 24 additions & 0 deletions lua/carnifx/plugins/neo-tree.lua
Original file line number Diff line number Diff line change
@@ -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,
}
File renamed without changes.
5 changes: 5 additions & 0 deletions lua/carnifx/plugins/typescript-tools.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
return {
'pmizio/typescript-tools.nvim',
dependencies = { 'nvim-lua/plenary.nvim', 'neovim/nvim-lspconfig' },
opts = {},
}
10 changes: 10 additions & 0 deletions lua/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@
vim.opt.hlsearch = true
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- exit insert mode
vim.keymap.set('i', 'jk', '<ESC>')

-- 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<CR>', { 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' })
Expand Down Expand Up @@ -34,6 +40,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })

-- Neo-tree Keybinds
vim.keymap.set('n', '<leader>no', ':Neotree<CR>', { desc = 'Open Neotree' })
vim.keymap.set('n', '<leader>nc', ':Neotree close right<CR>', { desc = 'Close Neotree' })

-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`

Expand Down
1 change: 1 addition & 0 deletions lua/kickstart/plugins/which-key.lua
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ return {
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
['<leader>n'] = { name = '[N]eotree', _ = 'which_key_ignore' },
}
end,
},
Expand Down
14 changes: 11 additions & 3 deletions lua/lazy-plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -32,8 +37,6 @@ require('lazy').setup({

require 'kickstart/plugins/which-key',

require 'kickstart/plugins/telescope',

require 'kickstart/plugins/lspconfig',

require 'kickstart/plugins/conform',
Expand All @@ -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.
Expand Down
5 changes: 2 additions & 3 deletions lua/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down