This commit is contained in:
Nikola Savic 2024-09-09 14:13:06 +02:00
parent a22976111e
commit f8596bb0c6
16 changed files with 1252 additions and 79 deletions

210
init.lua
View File

@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true vim.opt.number = true
-- You can also add relative line numbers, to help with jumping. -- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it! -- 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! -- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a' vim.opt.mouse = 'a'
@ -160,12 +160,15 @@ vim.opt.scrolloff = 10
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
-- For conciseness
local opts = { noremap = true, silent = true }
-- Clear highlights on search when pressing <Esc> in normal mode -- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch` -- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>') vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- Diagnostic keymaps -- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' }) -- vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier -- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which -- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
@ -190,6 +193,45 @@ 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-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' }) vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
-- Keymaps to save, quit and old habbits
vim.keymap.set('n', '<leader>w', '<cmd>w!<CR>', { desc = 'Save file' })
-- save file without auto-formatting
vim.keymap.set('n', '<leader>W', '<cmd>noautocmd w <CR>', { desc = 'Save without formatting' })
vim.keymap.set('n', '<leader>q', '<cmd>q!<CR>', { desc = 'Close file' })
-- Keep last yanked when pasting
vim.keymap.set('v', 'p', '"_dP', opts)
-- Vertical scroll and center
vim.keymap.set('n', '<C-d>', '<C-d>zz', opts)
vim.keymap.set('n', '<C-u>', '<C-u>zz', opts)
-- Find and center
vim.keymap.set('n', 'n', 'nzzzv', opts)
vim.keymap.set('n', 'N', 'Nzzzv', opts)
-- Window management
vim.keymap.set('n', '<leader>v', '<C-w>v', opts) -- split window vertically
vim.keymap.set('n', '<leader>h', '<C-w>s', opts) -- split window horizontally
vim.keymap.set('n', '<leader>se', '<C-w>=', opts) -- make split windows equal width & height
vim.keymap.set('n', '<leader>xs', ':close<CR>', opts) -- close current split window
-- Navigate between splits
vim.keymap.set('n', '<C-k>', ':wincmd k<CR>', opts)
vim.keymap.set('n', '<C-j>', ':wincmd j<CR>', opts)
vim.keymap.set('n', '<C-h>', ':wincmd h<CR>', opts)
vim.keymap.set('n', '<C-l>', ':wincmd l<CR>', opts)
-- Tabs
vim.keymap.set('n', '<leader>to', ':tabnew<CR>', opts) -- open new tab
vim.keymap.set('n', '<leader>tx', ':tabclose<CR>', opts) -- close current tab
vim.keymap.set('n', '<leader>tn', ':tabn<CR>', opts) -- go to next tab
vim.keymap.set('n', '<leader>tp', ':tabp<CR>', opts) -- go to previous tab
-- Stay in indent mode
vim.keymap.set('v', '<', '<gv', opts)
vim.keymap.set('v', '>', '>gv', opts)
-- [[ Basic Autocommands ]] -- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands` -- See `:help lua-guide-autocommands`
@ -243,19 +285,19 @@ require('lazy').setup({
-- require('gitsigns').setup({ ... }) -- require('gitsigns').setup({ ... })
-- --
-- See `:help gitsigns` to understand what the configuration keys do -- See `:help gitsigns` to understand what the configuration keys do
{ -- Adds git related signs to the gutter, as well as utilities for managing changes -- { -- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim', -- 'lewis6991/gitsigns.nvim',
opts = { -- opts = {
signs = { -- signs = {
add = { text = '+' }, -- add = { text = '+' },
change = { text = '~' }, -- change = { text = '~' },
delete = { text = '_' }, -- delete = { text = '_' },
topdelete = { text = '' }, -- topdelete = { text = '‾' },
changedelete = { text = '~' }, -- changedelete = { text = '~' },
}, -- },
}, -- },
}, -- },
--
-- NOTE: Plugins can also be configured to run Lua code when they are loaded. -- NOTE: Plugins can also be configured to run Lua code when they are loaded.
-- --
-- This is often very useful to both group configuration, as well as handle -- This is often very useful to both group configuration, as well as handle
@ -317,8 +359,8 @@ require('lazy').setup({
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } }, { '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
{ '<leader>d', group = '[D]ocument' }, { '<leader>d', group = '[D]ocument' },
{ '<leader>r', group = '[R]ename' }, { '<leader>r', group = '[R]ename' },
{ '<leader>s', group = '[S]earch' }, { '<leader>f', group = '[S]earch' },
{ '<leader>w', group = '[W]orkspace' }, -- { '<leader>w', group = '[W]orkspace' },
{ '<leader>t', group = '[T]oggle' }, { '<leader>t', group = '[T]oggle' },
{ '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } }, { '<leader>h', group = 'Git [H]unk', mode = { 'n', 'v' } },
}, },
@ -401,19 +443,19 @@ require('lazy').setup({
-- See `:help telescope.builtin` -- See `:help telescope.builtin`
local builtin = require 'telescope.builtin' local builtin = require 'telescope.builtin'
vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', '<leader>fh', builtin.help_tags, { desc = '[S]earch [H]elp' })
vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' }) vim.keymap.set('n', '<leader>fk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', '<leader>ff', builtin.find_files, { desc = '[S]earch [F]iles' })
vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' }) vim.keymap.set('n', '<leader>fs', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' }) vim.keymap.set('n', '<leader>fc', builtin.grep_string, { desc = '[S]earch current [W]ord' })
vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' }) vim.keymap.set('n', '<leader>fw', builtin.live_grep, { desc = '[S]earch by [G]rep' })
vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', '<leader>fd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' }) vim.keymap.set('n', '<leader>f<CR>', builtin.resume, { desc = '[S]earch [R]esume' })
vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' }) vim.keymap.set('n', '<leader>fo', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' }) vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
-- Slightly advanced example of overriding default behavior and theme -- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function() vim.keymap.set('n', '<leader>s/', function()
-- You can pass additional configuration to Telescope to change the theme, layout, etc. -- You can pass additional configuration to Telescope to change the theme, layout, etc.
builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown { builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
winblend = 10, winblend = 10,
@ -423,12 +465,12 @@ require('lazy').setup({
-- It's also possible to pass additional configuration options. -- It's also possible to pass additional configuration options.
-- See `:help telescope.builtin.live_grep()` for information about particular keys -- See `:help telescope.builtin.live_grep()` for information about particular keys
vim.keymap.set('n', '<leader>s/', function() -- vim.keymap.set('n', '<leader>s/', function()
builtin.live_grep { -- builtin.live_grep {
grep_open_files = true, -- grep_open_files = true,
prompt_title = 'Live Grep in Open Files', -- prompt_title = 'Live Grep in Open Files',
} -- }
end, { desc = '[S]earch [/] in Open Files' }) -- end, { desc = '[S]earch [/] in Open Files' })
-- Shortcut for searching your Neovim configuration files -- Shortcut for searching your Neovim configuration files
vim.keymap.set('n', '<leader>sn', function() vim.keymap.set('n', '<leader>sn', function()
@ -533,15 +575,15 @@ require('lazy').setup({
-- Fuzzy find all the symbols in your current workspace. -- Fuzzy find all the symbols in your current workspace.
-- Similar to document symbols, except searches over your entire project. -- Similar to document symbols, except searches over your entire project.
map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols') -- map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
-- Rename the variable under your cursor. -- Rename the variable under your cursor.
-- Most Language Servers support renaming across files, etc. -- Most Language Servers support renaming across files, etc.
map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') map('<leader>ln', vim.lsp.buf.rename, '[R]e[n]ame')
-- Execute a code action, usually your cursor needs to be on top of an error -- Execute a code action, usually your cursor needs to be on top of an error
-- or a suggestion from your LSP for this to activate. -- or a suggestion from your LSP for this to activate.
map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' }) map('<leader>la', vim.lsp.buf.code_action, '[C]ode [A]ction', { 'n', 'x' })
-- WARN: This is not Goto Definition, this is Goto Declaration. -- WARN: This is not Goto Definition, this is Goto Declaration.
-- For example, in C this would take you to the header. -- For example, in C this would take you to the header.
@ -580,11 +622,11 @@ require('lazy').setup({
-- code, if the language server you are using supports them -- code, if the language server you are using supports them
-- --
-- This may be unwanted, since they displace some of your code -- This may be unwanted, since they displace some of your code
if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then -- if client and client.supports_method(vim.lsp.protocol.Methods.textDocument_inlayHint) then
map('<leader>th', function() -- map('<leader>th', function()
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf }) -- vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled { bufnr = event.buf })
end, '[T]oggle Inlay [H]ints') -- end, '[T]oggle Inlay [H]ints')
end -- end
end, end,
}) })
@ -605,6 +647,18 @@ require('lazy').setup({
-- - settings (table): Override the default settings passed when initializing the server. -- - settings (table): Override the default settings passed when initializing the server.
-- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/ -- For example, to see the options for `lua_ls`, you could go to: https://luals.github.io/wiki/settings/
local servers = { local servers = {
intelephense = {
settings = {
intelephense = {
diagnostics = {
undefinedProperties = false,
undefinedMethods = false,
undefinedTypes = false,
undefinedFunctions = false,
},
},
},
},
-- clangd = {}, -- clangd = {},
-- gopls = {}, -- gopls = {},
-- pyright = {}, -- pyright = {},
@ -728,12 +782,12 @@ require('lazy').setup({
-- `friendly-snippets` contains a variety of premade snippets. -- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets: -- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets -- https://github.com/rafamadriz/friendly-snippets
-- { {
-- 'rafamadriz/friendly-snippets', 'rafamadriz/friendly-snippets',
-- config = function() config = function()
-- require('luasnip.loaders.from_vscode').lazy_load() require('luasnip.loaders.from_vscode').lazy_load()
-- end, end,
-- }, },
}, },
}, },
'saadparwaiz1/cmp_luasnip', 'saadparwaiz1/cmp_luasnip',
@ -824,23 +878,23 @@ require('lazy').setup({
end, end,
}, },
{ -- You can easily change to a different colorscheme. -- { -- You can easily change to a different colorscheme.
-- Change the name of the colorscheme plugin below, and then -- -- Change the name of the colorscheme plugin below, and then
-- change the command in the config to whatever the name of that colorscheme is. -- -- change the command in the config to whatever the name of that colorscheme is.
-- --
-- -- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
-- 'folke/tokyonight.nvim',
-- priority = 1000, -- Make sure to load this before all the other start plugins.
-- init = function()
-- -- 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'
-- --
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`. -- -- You can configure highlights by doing something like:
'folke/tokyonight.nvim', -- vim.cmd.hi 'Comment gui=none'
priority = 1000, -- Make sure to load this before all the other start plugins. -- end,
init = function() -- },
-- 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'
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
end,
},
-- Highlight todo, notes, etc in comments -- Highlight todo, notes, etc in comments
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } }, { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
@ -888,7 +942,7 @@ require('lazy').setup({
main = 'nvim-treesitter.configs', -- Sets main module to use for opts main = 'nvim-treesitter.configs', -- Sets main module to use for opts
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
opts = { opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }, ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'php', 'javascript' },
-- Autoinstall languages that are not installed -- Autoinstall languages that are not installed
auto_install = true, auto_install = true,
highlight = { highlight = {
@ -929,25 +983,25 @@ require('lazy').setup({
-- --
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins` -- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' }, { import = 'custom.plugins' },
}, { }, {
ui = { ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the -- If you are using a Nerd Font: set icons to an empty table which will use the
-- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table -- default lazy.nvim defined Nerd Font icons, otherwise define a unicode icons table
icons = vim.g.have_nerd_font and {} or { icons = vim.g.have_nerd_font and {} or {
cmd = '', -- cmd = '⌘',
config = '🛠', -- config = '🛠',
event = '📅', -- event = '📅',
ft = '📂', -- ft = '📂',
init = '', -- init = '⚙',
keys = '🗝', -- keys = '🗝',
plugin = '🔌', -- plugin = '🔌',
runtime = '💻', -- runtime = '💻',
require = '🌙', -- require = '🌙',
source = '📄', -- source = '📄',
start = '🚀', -- start = '🚀',
task = '📌', -- task = '📌',
lazy = '💤 ', -- lazy = '💤 ',
}, },
}, },
}) })

View File

@ -0,0 +1,24 @@
return {
'goolord/alpha-nvim',
dependencies = {
'nvim-tree/nvim-web-devicons',
},
config = function()
local alpha = require 'alpha'
local dashboard = require 'alpha.themes.startify'
dashboard.section.header.val = {
[[ ]],
[[ ███╗ ██╗███████╗ ██████╗ ██╗ ██╗██╗███╗ ███╗ ]],
[[ ████╗ ██║██╔════╝██╔═══██╗██║ ██║██║████╗ ████║ ]],
[[ ██╔██╗ ██║█████╗ ██║ ██║██║ ██║██║██╔████╔██║ ]],
[[ ██║╚██╗██║██╔══╝ ██║ ██║╚██╗ ██╔╝██║██║╚██╔╝██║ ]],
[[ ██║ ╚████║███████╗╚██████╔╝ ╚████╔╝ ██║██║ ╚═╝ ██║ ]],
[[ ╚═╝ ╚═══╝╚══════╝ ╚═════╝ ╚═══╝ ╚═╝╚═╝ ╚═╝ ]],
[[ ]],
}
alpha.setup(dashboard.opts)
end,
}

View File

@ -0,0 +1,175 @@
return { -- Autocompletion
'hrsh7th/nvim-cmp',
dependencies = {
-- Snippet Engine & its associated nvim-cmp source
{
'L3MON4D3/LuaSnip',
build = (function()
-- Build Step is needed for regex support in snippets.
-- This step is not supported in many windows environments.
-- Remove the below condition to re-enable on windows.
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
return
end
return 'make install_jsregexp'
end)(),
dependencies = {
-- `friendly-snippets` contains a variety of premade snippets.
-- See the README about individual language/framework/plugin snippets:
-- https://github.com/rafamadriz/friendly-snippets
{
'rafamadriz/friendly-snippets',
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
end,
},
},
},
'saadparwaiz1/cmp_luasnip',
-- Adds other completion capabilities.
-- nvim-cmp does not ship with all sources by default. They are split
-- into multiple repos for maintenance purposes.
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
},
config = function()
-- See `:help cmp`
local cmp = require 'cmp'
local luasnip = require 'luasnip'
luasnip.config.setup {}
local kind_icons = {
Text = '󰉿',
Method = 'm',
Function = '󰊕',
Constructor = '',
Field = '',
Variable = '󰆧',
Class = '󰌗',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '󰎠',
Enum = '',
Keyword = '󰌋',
Snippet = '',
Color = '󰏘',
File = '󰈙',
Reference = '',
Folder = '󰉋',
EnumMember = '',
Constant = '󰇽',
Struct = '',
Event = '',
Operator = '󰆕',
TypeParameter = '󰊄',
}
cmp.setup {
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
completion = { completeopt = 'menu,menuone,noinsert' },
-- For an understanding of why these mappings were
-- chosen, you will need to read `:help ins-completion`
--
-- 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(),
-- Select the [p]revious item
['<C-p>'] = cmp.mapping.select_prev_item(),
-- Scroll the documentation window [b]ack / [f]orward
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- 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-CR>'] = cmp.mapping.confirm { select = true },
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
['<CR>'] = cmp.mapping.confirm { select = true },
-- ['<Tab>'] = cmp.mapping.select_next_item(),
-- ['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available.
['<C-Space>'] = cmp.mapping.complete {},
-- Think of <c-l> as moving to the right of your snippet expansion.
-- So if you have a snippet that's like:
-- function $name($args)
-- $body
-- end
--
-- <c-l> will move you to the right of each of the expansion locations.
-- <c-h> is similar, except moving you backwards.
['<C-l>'] = cmp.mapping(function()
if luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
end
end, { 'i', 's' }),
['<C-h>'] = cmp.mapping(function()
if luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
end
end, { 'i', 's' }),
-- For more advanced Luasnip keymaps (e.g. selecting choice nodes, expansion) see:
-- https://github.com/L3MON4D3/LuaSnip?tab=readme-ov-file#keymaps
-- Select next/previous item with Tab / Shift + Tab
['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
elseif luasnip.expand_or_locally_jumpable() then
luasnip.expand_or_jump()
else
fallback()
end
end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_prev_item()
elseif luasnip.locally_jumpable(-1) then
luasnip.jump(-1)
else
fallback()
end
end, { 'i', 's' }),
},
sources = {
{
name = 'lazydev',
-- set group index to 0 to skip loading LuaLS completions as lazydev recommends it
group_index = 0,
},
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
{ name = 'buffer' },
{ name = 'path' },
},
formatting = {
fields = { 'kind', 'abbr', 'menu' },
format = function(entry, vim_item)
vim_item.kind = string.format('%s', kind_icons[vim_item.kind])
vim_item.menu = ({
nvim_lsp = '[LSP]',
luasnip = '[Snippet]',
buffer = '[Buffer]',
path = '[Path]',
})[entry.source.name]
return vim_item
end,
},
}
end,
}

View File

@ -0,0 +1,70 @@
return {
'akinsho/bufferline.nvim',
dependencies = {
'moll/vim-bbye',
'nvim-tree/nvim-web-devicons',
},
config = function()
local opts = { noremap = true, silent = true }
require('bufferline').setup {
options = {
mode = 'buffers', -- set to "tabs" to only show tabpages instead
themable = true, -- allows highlight groups to be overriden i.e. sets highlights as default
numbers = 'none', -- | "ordinal" | "buffer_id" | "both" | function({ ordinal, id, lower, raise }): string,
close_command = 'Bdelete! %d', -- can be a string | function, see "Mouse actions"
buffer_close_icon = '',
close_icon = '',
path_components = 1, -- Show only the file name without the directory
modified_icon = '',
left_trunc_marker = '',
right_trunc_marker = '',
max_name_length = 30,
max_prefix_length = 30, -- prefix used when a buffer is de-duplicated
tab_size = 21,
diagnostics = false,
diagnostics_update_in_insert = false,
color_icons = true,
show_buffer_icons = true,
show_buffer_close_icons = true,
show_close_icon = true,
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
separator_style = { '', '' }, -- | "thick" | "thin" | { 'any', 'any' },
enforce_regular_tabs = true,
always_show_bufferline = true,
show_tab_indicators = false,
indicator = {
-- icon = '▎', -- this should be omitted if indicator style is not 'icon'
style = 'none', -- Options: 'icon', 'underline', 'none'
},
icon_pinned = '󰐃',
minimum_padding = 1,
maximum_padding = 5,
maximum_length = 15,
sort_by = 'insert_at_end',
},
highlights = {
separator = {
fg = '#434C5E',
},
buffer_selected = {
bold = true,
italic = false,
},
-- separator_selected = {},
-- tab_selected = {},
-- background = {},
-- indicator_selected = {},
-- fill = {},
},
}
-- Buffers
vim.keymap.set('n', '<Tab>', ':bnext<CR>', opts)
vim.keymap.set('n', '<S-Tab>', ':bprevious<CR>', opts)
vim.keymap.set('n', '<leader>x', ':Bdelete!<CR>', opts) -- close buffer
vim.keymap.set('n', '<leader>b', '<cmd> enew <CR>', opts) -- new buffer
end,
}

View File

@ -0,0 +1,71 @@
return {
'catppuccin/nvim',
name = 'catppuccin',
priority = 1000,
config = function()
require('catppuccin').setup {
flavour = 'auto', -- latte, frappe, macchiato, mocha
background = { -- :h background
light = 'latte',
dark = 'mocha',
},
transparent_background = true, -- disables setting the background color.
show_end_of_buffer = false, -- shows the '~' characters after the end of buffers
term_colors = false, -- sets terminal colors (e.g. `g:terminal_color_0`)
dim_inactive = {
enabled = false, -- dims the background color of inactive window
shade = 'dark',
percentage = 0.15, -- percentage of the shade to apply to the inactive window
},
no_italic = false, -- Force no italic
no_bold = false, -- Force no bold
no_underline = false, -- Force no underline
styles = { -- Handles the styles of general hi groups (see `:h highlight-args`):
comments = { 'italic' }, -- Change the style of comments
conditionals = { 'italic' },
loops = {},
functions = {},
keywords = {},
strings = {},
variables = {},
numbers = {},
booleans = {},
properties = {},
types = {},
operators = {},
-- miscs = {}, -- Uncomment to turn off hard-coded styles
},
color_overrides = {},
custom_highlights = {},
default_integrations = true,
integrations = {
cmp = true,
gitsigns = true,
nvimtree = true,
treesitter = true,
notify = false,
mini = {
enabled = true,
indentscope_color = '',
},
-- For more plugins integrations please scroll down (https://github.com/catppuccin/nvim#integrations)
},
}
-- -- Toggle background transparency
local bg_transparent = true
--
local toggle_transparency = function()
bg_transparent = not bg_transparent
-- vim.g.transparent_background = bg_transparent
require('catppuccin').setup {
transparent_background = bg_transparent,
}
vim.cmd [[colorscheme catppuccin]]
end
vim.keymap.set('n', '<leader>bg', toggle_transparency, { noremap = true, silent = true })
-- setup must be called before loading
vim.cmd.colorscheme 'catppuccin'
end,
}

View File

@ -0,0 +1,10 @@
-- Easily comment visual regions/lines
return {
'numToStr/Comment.nvim',
opts = {},
config = function()
local opts = { noremap = true, silent = true }
vim.keymap.set('n', '<leader>/', require('Comment.api').toggle.linewise.current, opts)
vim.keymap.set('v', '<leader>/', "<esc><cmd>lua require('Comment.api').toggle.linewise(vim.fn.visualmode())<cr>", opts)
end,
}

View File

@ -0,0 +1,46 @@
return {
{
'CopilotC-Nvim/CopilotChat.nvim',
branch = 'canary',
dependencies = {
{ 'zbirenbaum/copilot.lua' }, -- or github/copilot.vim
{ 'nvim-lua/plenary.nvim' }, -- for curl, log wrapper
},
build = 'make tiktoken', -- Only on MacOS or Linux
keys = {
{
'<leader>ccq',
function()
local input = vim.fn.input 'Quick Chat: '
if input ~= '' then
require('CopilotChat').ask(input, { selection = require('CopilotChat.select').buffer })
end
end,
desc = 'CopilotChat Buffer chat',
},
{
'<leader>cct',
'<cmd>CopilotChatToggle<CR>',
desc = 'Copilot Chat Toggle',
},
-- {
-- '<leader>ccs',
-- 'CopilotChatSave',
-- desc = 'CopilotChat - Quick chat',
-- },
},
opts = {
debug = false, -- Enable debug logging
window = {
layout = 'float',
relative = 'editor',
title = 'Copilot',
footer = '<C-i> to toggle chat | <C-l> to clean chat',
width = 0.6,
height = 0.5,
row = 0,
border = 'rounded', -- 'none', single', 'double', 'rounded', 'solid', 'shadow'
},
},
},
}

View File

@ -0,0 +1,5 @@
return {
'scottmckendry/cyberdream.nvim',
lazy = false,
-- priority = 1000,
}

View File

@ -0,0 +1,167 @@
return {
'stevearc/dressing.nvim',
opts = {
-- require('dressing').setup {
input = {
-- Set to false to disable the vim.ui.input implementation
enabled = true,
-- Default prompt string
default_prompt = 'Input',
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Can be 'left', 'right', or 'center'
title_pos = 'left',
-- When true, input will start in insert mode.
start_in_insert = true,
-- These are passed to nvim_open_win
border = 'rounded',
-- 'editor' and 'win' will default to being centered
relative = 'cursor',
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
prefer_width = 40,
width = nil,
-- min_width and max_width can be a list of mixed types.
-- min_width = {20, 0.2} means "the greater of 20 columns or 20% of total"
max_width = { 140, 0.9 },
min_width = { 20, 0.2 },
buf_options = {},
win_options = {
-- Disable line wrapping
wrap = false,
-- Indicator for when text exceeds window
list = true,
listchars = 'precedes:…,extends:…',
-- Increase this for more context when text scrolls off the window
sidescrolloff = 0,
},
-- Set to `false` to disable
mappings = {
n = {
['<Esc>'] = 'Close',
['<CR>'] = 'Confirm',
},
i = {
['<C-c>'] = 'Close',
['<CR>'] = 'Confirm',
['<Up>'] = 'HistoryPrev',
['<Down>'] = 'HistoryNext',
},
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
-- see :help dressing_get_config
get_config = nil,
},
select = {
-- Set to false to disable the vim.ui.select implementation
enabled = true,
-- Priority list of preferred vim.select implementations
backend = { 'telescope', 'fzf_lua', 'fzf', 'builtin', 'nui' },
-- Trim trailing `:` from prompt
trim_prompt = true,
-- Options for telescope selector
-- These are passed into the telescope picker directly. Can be used like:
-- telescope = require('telescope.themes').get_ivy({...})
telescope = nil,
-- Options for fzf selector
fzf = {
window = {
width = 0.5,
height = 0.4,
},
},
-- Options for fzf-lua
fzf_lua = {
-- winopts = {
-- height = 0.5,
-- width = 0.5,
-- },
},
-- Options for nui Menu
nui = {
position = '50%',
size = nil,
relative = 'editor',
border = {
style = 'rounded',
},
buf_options = {
swapfile = false,
filetype = 'DressingSelect',
},
win_options = {
winblend = 0,
},
max_width = 80,
max_height = 40,
min_width = 40,
min_height = 10,
},
-- Options for built-in selector
builtin = {
-- Display numbers for options and set up keymaps
show_numbers = true,
-- These are passed to nvim_open_win
border = 'rounded',
-- 'editor' and 'win' will default to being centered
relative = 'editor',
buf_options = {},
win_options = {
cursorline = true,
cursorlineopt = 'both',
},
-- These can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- the min_ and max_ options can be a list of mixed types.
-- max_width = {140, 0.8} means "the lesser of 140 columns or 80% of total"
width = nil,
max_width = { 140, 0.8 },
min_width = { 40, 0.2 },
height = nil,
max_height = 0.9,
min_height = { 10, 0.2 },
-- Set to `false` to disable
mappings = {
['<Esc>'] = 'Close',
['<C-c>'] = 'Close',
['<CR>'] = 'Confirm',
},
override = function(conf)
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
return conf
end,
},
-- Used to override format_item. See :help dressing-format
format_item_override = {},
-- see :help dressing_get_config
get_config = nil,
},
},
-- },
}

View File

@ -0,0 +1,20 @@
-- Adds git related signs to the gutter, as well as utilities for managing changes
return {
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
signs_staged = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
},
}

View File

@ -0,0 +1,25 @@
return {
'lukas-reineke/indent-blankline.nvim',
main = 'ibl',
opts = {
indent = {
char = '',
},
scope = {
show_start = false,
show_end = false,
show_exact_scope = false,
},
exclude = {
filetypes = {
'help',
'startify',
'dashboard',
'packer',
'neogitstatus',
'NvimTree',
'Trouble',
},
},
},
}

View File

@ -0,0 +1,20 @@
-- nvim v0.8.0
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 = {
{ '<leader>tg', '<cmd>LazyGit<cr>', desc = 'LazyGit' },
},
}

View File

@ -0,0 +1,72 @@
return {
'nvim-lualine/lualine.nvim',
config = function()
local mode = {
'mode',
fmt = function(str)
return '' .. str
-- return ' ' .. str:sub(1, 1) -- displays only the first character of the mode
end,
}
local filename = {
'filename',
file_status = true, -- displays file status (readonly status, modified status)
path = 0, -- 0 = just filename, 1 = relative path, 2 = absolute path
}
local hide_in_width = function()
return vim.fn.winwidth(0) > 100
end
local diagnostics = {
'diagnostics',
sources = { 'nvim_diagnostic' },
sections = { 'error', 'warn' },
symbols = { error = '', warn = '', info = '', hint = '' },
colored = false,
update_in_insert = false,
always_visible = false,
cond = hide_in_width,
}
local diff = {
'diff',
colored = false,
symbols = { added = '', modified = '', removed = '' }, -- changes diff symbols
cond = hide_in_width,
}
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'catppuccin', -- Set theme based on environment variable
-- Some useful glyphs:
-- https://www.nerdfonts.com/cheat-sheet
--        
section_separators = { left = '', right = '' },
component_separators = { left = '', right = '' },
disabled_filetypes = { 'neo-tree' },
always_divide_middle = true,
},
sections = {
lualine_a = { mode },
lualine_b = { 'branch' },
lualine_c = { filename },
lualine_x = { diagnostics, diff, { 'encoding', cond = hide_in_width }, { 'filetype', cond = hide_in_width } },
lualine_y = { 'location' },
lualine_z = { 'progress' },
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = { { 'filename', path = 1 } },
lualine_x = { { 'location', padding = 0 } },
lualine_y = {},
lualine_z = {},
},
tabline = {},
extensions = { 'lazy', 'toggleterm', 'mason', 'neo-tree', 'trouble' },
}
end,
}

View File

@ -0,0 +1,67 @@
return {
{
-- smooth scroll
'declancm/cinnamon.nvim',
version = '*', -- use latest release
opts = {
-- change default options here
},
},
{
'windwp/nvim-autopairs',
event = 'InsertEnter',
config = true,
-- use opts = {} for passing setup options
-- this is equivalent to setup({}) function
},
{
-- sessions
'folke/persistence.nvim',
event = 'BufReadPre', -- this will only start session saving when an actual file was opened
opts = {
-- load the session for the current directory
vim.keymap.set('n', '<leader>Ss', function()
require('persistence').load()
end, { desc = 'Load session from directory' }),
-- select a session to load
vim.keymap.set('n', '<leader>SS', function()
require('persistence').select()
end, { desc = 'Select a sesion to load' }),
-- load the last session
vim.keymap.set('n', '<leader>Sl', function()
require('persistence').load { last = true }
end, { desc = 'Load the last session' }),
-- stop Persistence => session won't be saved on exit
vim.keymap.set('n', '<leader>Sd', function()
require('persistence').stop()
end, { desc = 'Stop Saving sessions' }),
-- add any custom options here
},
},
{
'karb94/neoscroll.nvim',
config = function()
require('neoscroll').setup {}
end,
},
{
'christoomey/vim-tmux-navigator',
cmd = {
'TmuxNavigateLeft',
'TmuxNavigateDown',
'TmuxNavigateUp',
'TmuxNavigateRight',
'TmuxNavigatePrevious',
},
keys = {
{ '<c-h>', '<cmd><C-U>TmuxNavigateLeft<cr>' },
{ '<c-j>', '<cmd><C-U>TmuxNavigateDown<cr>' },
{ '<c-k>', '<cmd><C-U>TmuxNavigateUp<cr>' },
{ '<c-l>', '<cmd><C-U>TmuxNavigateRight<cr>' },
{ '<c-\\>', '<cmd><C-U>TmuxNavigatePrevious<cr>' },
},
},
}

View File

@ -0,0 +1,326 @@
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
{
's1n7ax/nvim-window-picker',
version = '2.*',
config = function()
require('window-picker').setup {
filter_rules = {
include_current_win = false,
autoselect_one = true,
-- filter using buffer options
bo = {
-- if the file type is one of following, the window will be ignored
filetype = { 'neo-tree', 'neo-tree-popup', 'notify' },
-- if the buffer type is one of following, the window will be ignored
buftype = { 'terminal', 'quickfix' },
},
},
}
end,
},
},
config = function()
-- If you want icons for diagnostic errors, you'll need to define them somewhere:
vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' })
vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' })
vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' })
vim.fn.sign_define('DiagnosticSignHint', { text = '󰌵', texthl = 'DiagnosticSignHint' })
require('neo-tree').setup {
close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab
popup_border_style = 'rounded',
enable_git_status = true,
enable_diagnostics = true,
open_files_do_not_replace_types = { 'terminal', 'trouble', 'qf' }, -- when opening files, do not use windows containing these filetypes or buftypes
sort_case_insensitive = false, -- used when sorting files and directories in the tree
sort_function = nil, -- use a custom function for sorting files and directories in the tree
-- sort_function = function (a,b)
-- if a.type == b.type then
-- return a.path > b.path
-- else
-- return a.type > b.type
-- end
-- end , -- this sorts files and directories descendantly
default_component_configs = {
container = {
enable_character_fade = true,
},
indent = {
indent_size = 2,
padding = 1, -- extra padding on left hand side
-- indent guides
with_markers = true,
indent_marker = '',
last_indent_marker = '',
highlight = 'NeoTreeIndentMarker',
-- expander config, needed for nesting files
with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders
expander_collapsed = '',
expander_expanded = '',
expander_highlight = 'NeoTreeExpander',
},
icon = {
folder_closed = '',
folder_open = '',
folder_empty = '󰜌',
provider = function(icon, node, state) -- default icon provider utilizes nvim-web-devicons if available
if node.type == 'file' or node.type == 'terminal' then
local success, web_devicons = pcall(require, 'nvim-web-devicons')
local name = node.type == 'terminal' and 'terminal' or node.name
if success then
local devicon, hl = web_devicons.get_icon(name)
icon.text = devicon or icon.text
icon.highlight = hl or icon.highlight
end
end
end,
-- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there
-- then these will never be used.
default = '*',
highlight = 'NeoTreeFileIcon',
},
modified = {
symbol = '[+]',
highlight = 'NeoTreeModified',
},
name = {
trailing_slash = false,
use_git_status_colors = true,
highlight = 'NeoTreeFileName',
},
git_status = {
symbols = {
-- Change type
added = '', -- or "✚", but this is redundant info if you use git_status_colors on the name
modified = '', -- or "", but this is redundant info if you use git_status_colors on the name
deleted = '', -- this can only be used in the git_status source
renamed = '󰁕', -- this can only be used in the git_status source
-- Status type
untracked = '',
ignored = '',
unstaged = '󰄱',
staged = '',
conflict = '',
},
},
-- If you don't want to use these columns, you can set `enabled = false` for each of them individually
file_size = {
enabled = true,
required_width = 64, -- min width of window required to show this column
},
type = {
enabled = true,
required_width = 122, -- min width of window required to show this column
},
last_modified = {
enabled = true,
required_width = 88, -- min width of window required to show this column
},
created = {
enabled = true,
required_width = 110, -- min width of window required to show this column
},
symlink_target = {
enabled = false,
},
},
-- A list of functions, each representing a global custom command
-- that will be available in all sources (if not overridden in `opts[source_name].commands`)
-- see `:h neo-tree-custom-commands-global`
commands = {},
window = {
position = 'right',
width = 40,
mapping_options = {
noremap = true,
nowait = true,
},
mappings = {
['<space>'] = {
'toggle_node',
nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use
},
['<2-LeftMouse>'] = 'open',
['<cr>'] = 'open',
['<esc>'] = 'cancel', -- close preview or floating neo-tree window
['P'] = { 'toggle_preview', config = { use_float = true, use_image_nvim = true } },
-- Read `# Preview Mode` for more information
['l'] = 'focus_preview',
['S'] = 'open_split',
['s'] = 'open_vsplit',
-- ["S"] = "split_with_window_picker",
-- ["s"] = "vsplit_with_window_picker",
['t'] = 'open_tabnew',
-- ["<cr>"] = "open_drop",
-- ["t"] = "open_tab_drop",
['w'] = 'open_with_window_picker',
--["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing
['C'] = 'close_node',
-- ['C'] = 'close_all_subnodes',
['z'] = 'close_all_nodes',
--["Z"] = "expand_all_nodes",
['a'] = {
'add',
-- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details
-- some commands may take optional config options, see `:h neo-tree-mappings` for details
config = {
show_path = 'none', -- "none", "relative", "absolute"
},
},
['A'] = 'add_directory', -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion.
['d'] = 'delete',
['r'] = 'rename',
['y'] = 'copy_to_clipboard',
['x'] = 'cut_to_clipboard',
['p'] = 'paste_from_clipboard',
['c'] = 'copy', -- takes text input for destination, also accepts the optional config.show_path option like "add":
-- ["c"] = {
-- "copy",
-- config = {
-- show_path = "none" -- "none", "relative", "absolute"
-- }
--}
['m'] = 'move', -- takes text input for destination, also accepts the optional config.show_path option like "add".
['q'] = 'close_window',
['R'] = 'refresh',
['?'] = 'show_help',
['<'] = 'prev_source',
['>'] = 'next_source',
['i'] = 'show_file_details',
},
},
nesting_rules = {},
filesystem = {
filtered_items = {
visible = false, -- when true, they will just be displayed differently than normal items
hide_dotfiles = true,
hide_gitignored = true,
hide_hidden = true, -- only works on Windows for hidden files/directories
hide_by_name = {
--"node_modules"
},
hide_by_pattern = { -- uses glob style patterns
--"*.meta",
--"*/src/*/tsconfig.json",
},
always_show = { -- remains visible even if other settings would normally hide it
--".gitignored",
},
always_show_by_pattern = { -- uses glob style patterns
--".env*",
},
never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show
--".DS_Store",
--"thumbs.db"
},
never_show_by_pattern = { -- uses glob style patterns
--".null-ls_*",
},
},
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = false, -- when true, empty folders will be grouped together
hijack_netrw_behavior = 'open_default', -- netrw disabled, opening a directory opens neo-tree
-- in whatever position is specified in window.position
-- "open_current", -- netrw disabled, opening a directory opens within the
-- window like netrw would, regardless of window.position
-- "disabled", -- netrw left alone, neo-tree does not handle opening dirs
use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes
-- instead of relying on nvim autocmd events.
window = {
mappings = {
['<bs>'] = 'navigate_up',
['.'] = 'set_root',
['H'] = 'toggle_hidden',
['/'] = 'fuzzy_finder',
['D'] = 'fuzzy_finder_directory',
['#'] = 'fuzzy_sorter', -- fuzzy sorting using the fzy algorithm
-- ["D"] = "fuzzy_sorter_directory",
['f'] = 'filter_on_submit',
['<c-x>'] = 'clear_filter',
['[g'] = 'prev_git_modified',
[']g'] = 'next_git_modified',
['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } },
['oc'] = { 'order_by_created', nowait = false },
['od'] = { 'order_by_diagnostics', nowait = false },
['og'] = { 'order_by_git_status', nowait = false },
['om'] = { 'order_by_modified', nowait = false },
['on'] = { 'order_by_name', nowait = false },
['os'] = { 'order_by_size', nowait = false },
['ot'] = { 'order_by_type', nowait = false },
-- ['<key>'] = function(state) ... end,
},
fuzzy_finder_mappings = { -- define keymaps for filter popup window in fuzzy_finder_mode
['<down>'] = 'move_cursor_down',
['<C-n>'] = 'move_cursor_down',
['<up>'] = 'move_cursor_up',
['<C-p>'] = 'move_cursor_up',
-- ['<key>'] = function(state, scroll_padding) ... end,
},
},
commands = {}, -- Add a custom command or override a global one using the same function name
},
buffers = {
follow_current_file = {
enabled = true, -- This will find and focus the file in the active buffer every time
-- -- the current file is changed while the tree is open.
leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal`
},
group_empty_dirs = true, -- when true, empty folders will be grouped together
show_unloaded = true,
window = {
mappings = {
['bd'] = 'buffer_delete',
['<bs>'] = 'navigate_up',
['.'] = 'set_root',
['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } },
['oc'] = { 'order_by_created', nowait = false },
['od'] = { 'order_by_diagnostics', nowait = false },
['om'] = { 'order_by_modified', nowait = false },
['on'] = { 'order_by_name', nowait = false },
['os'] = { 'order_by_size', nowait = false },
['ot'] = { 'order_by_type', nowait = false },
},
},
},
git_status = {
window = {
position = 'float',
mappings = {
['A'] = 'git_add_all',
['gu'] = 'git_unstage_file',
['ga'] = 'git_add_file',
['gr'] = 'git_revert_file',
['gc'] = 'git_commit',
['gp'] = 'git_push',
['gg'] = 'git_commit_and_push',
['o'] = { 'show_help', nowait = false, config = { title = 'Order by', prefix_key = 'o' } },
['oc'] = { 'order_by_created', nowait = false },
['od'] = { 'order_by_diagnostics', nowait = false },
['om'] = { 'order_by_modified', nowait = false },
['on'] = { 'order_by_name', nowait = false },
['os'] = { 'order_by_size', nowait = false },
['ot'] = { 'order_by_type', nowait = false },
},
},
},
}
vim.cmd [[nnoremap \ :Neotree reveal<cr>]]
vim.keymap.set('n', '<leader>e', ':Neotree toggle position=right<CR>', { noremap = true, silent = true }) -- focus file explorer
vim.keymap.set('n', '<leader>ngs', ':Neotree float git_status<CR>', { noremap = true, silent = true }) -- open git status window
end,
},
}

View File

@ -0,0 +1,21 @@
return {
'akinsho/toggleterm.nvim',
version = '*',
keys = {
{
'<leader>tf',
'<cmd>ToggleTerm direction=float<CR>',
desc = 'Toggle Float Terminal',
},
-- {
-- '<leader>tv',
-- '<cmd>ToggleTerm direction=vertical<CR>',
-- desc = 'Toggle Vertcal Terminal',
-- },
-- {
-- '<leader>th',
-- '<cmd>ToggleTerm direction=horizontal<CR>',
-- desc = 'Toggle Horizontal Terminal',
-- },
},
}