Added nvim tree and other personal prefs

This commit is contained in:
ranger-ross 2024-05-01 22:41:04 +09:00
parent b7d5cc8f42
commit e2518e628a
No known key found for this signature in database
GPG Key ID: A7D198C212395322
1 changed files with 49 additions and 8 deletions

View File

@ -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`
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
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'
@ -190,6 +190,15 @@ 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' })
-- Nvim Tree config
vim.keymap.set('n', '<M-1>', function()
local api = require 'nvim-tree.api'
print 'run'
api.tree.toggle()
end)
-- vim.api.nvim_set_keymap('n', '<M-1>', api.tree.toggle, { noremap = true, silent = true })
-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`
@ -240,6 +249,7 @@ require('lazy').setup({
-- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} },
{ 'pocco81/auto-save.nvim' },
-- Here is a more advanced example where we pass configuration
-- options to `gitsigns.nvim`. This is equivalent to the following Lua:
-- require('gitsigns').setup({ ... })
@ -407,7 +417,22 @@ require('lazy').setup({
end, { desc = '[S]earch [N]eovim files' })
end,
},
{
'glepnir/nerdicons.nvim',
cmd = 'NerdIcons',
config = function()
require('nerdicons').setup {}
end,
},
{
'ibhagwan/fzf-lua',
-- optional for icon support
dependencies = { 'nvim-tree/nvim-web-devicons' },
config = function()
-- calling `setup` is optional for customization
require('fzf-lua').setup {}
end,
},
{ -- LSP Configuration & Plugins
'neovim/nvim-lspconfig',
dependencies = {
@ -661,7 +686,19 @@ require('lazy').setup({
},
},
},
{
'nvim-tree/nvim-tree.lua',
version = '*',
lazy = false,
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
require('nvim-tree').setup {
on_attach = ross_nvim_tree_attach,
}
end,
},
{ -- Autocompletion
'hrsh7th/nvim-cmp',
event = 'InsertEnter',
@ -718,7 +755,7 @@ require('lazy').setup({
-- No, but seriously. Please read `:help ins-completion`, it is really good!
mapping = cmp.mapping.preset.insert {
-- Select the [n]ext item
['<C-n>'] = cmp.mapping.select_next_item(),
['<Tab>'] = cmp.mapping.select_next_item(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
@ -729,7 +766,7 @@ require('lazy').setup({
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
['<Enter>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
@ -835,7 +872,7 @@ require('lazy').setup({
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
@ -863,7 +900,11 @@ require('lazy').setup({
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
end,
},
-- {
-- 'mrcjkb/rustaceanvim',
-- version = '^4', -- Recommended
-- lazy = false, -- This plugin is already lazy
-- },
-- 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.