|
|
|
@ -42,6 +42,9 @@ P.S. You can delete this when you're done too. It's your config now :)
|
|
|
|
|
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
|
|
|
|
|
vim.g.mapleader = ' '
|
|
|
|
|
vim.g.maplocalleader = ' '
|
|
|
|
|
vim.g.loaded_netrw = 1
|
|
|
|
|
vim.g.loaded_netrwPlugin = 1
|
|
|
|
|
vim.wo.relativenumber = true
|
|
|
|
|
|
|
|
|
|
-- Install package manager
|
|
|
|
|
-- https://github.com/folke/lazy.nvim
|
|
|
|
@ -61,7 +64,7 @@ vim.opt.rtp:prepend(lazypath)
|
|
|
|
|
|
|
|
|
|
-- NOTE: Here is where you install your plugins.
|
|
|
|
|
-- You can configure plugins using the `config` key.
|
|
|
|
|
--
|
|
|
|
|
|
|
|
|
|
-- You can also configure plugins after the setup call,
|
|
|
|
|
-- as they will be available in your neovim runtime.
|
|
|
|
|
require('lazy').setup({
|
|
|
|
@ -89,7 +92,7 @@ require('lazy').setup({
|
|
|
|
|
{ 'j-hui/fidget.nvim', tag = 'legacy', opts = {} },
|
|
|
|
|
|
|
|
|
|
-- Additional lua configuration, makes nvim stuff amazing!
|
|
|
|
|
'folke/neodev.nvim',
|
|
|
|
|
'folke/neodev.nvim'
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
@ -128,16 +131,16 @@ require('lazy').setup({
|
|
|
|
|
|
|
|
|
|
-- don't override the built-in and fugitive keymaps
|
|
|
|
|
local gs = package.loaded.gitsigns
|
|
|
|
|
vim.keymap.set({'n', 'v'}, ']c', function()
|
|
|
|
|
vim.keymap.set({ 'n', 'v' }, ']c', function()
|
|
|
|
|
if vim.wo.diff then return ']c' end
|
|
|
|
|
vim.schedule(function() gs.next_hunk() end)
|
|
|
|
|
return '<Ignore>'
|
|
|
|
|
end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"})
|
|
|
|
|
vim.keymap.set({'n', 'v'}, '[c', function()
|
|
|
|
|
end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" })
|
|
|
|
|
vim.keymap.set({ 'n', 'v' }, '[c', function()
|
|
|
|
|
if vim.wo.diff then return '[c' end
|
|
|
|
|
vim.schedule(function() gs.prev_hunk() end)
|
|
|
|
|
return '<Ignore>'
|
|
|
|
|
end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"})
|
|
|
|
|
end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" })
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
@ -157,7 +160,7 @@ require('lazy').setup({
|
|
|
|
|
-- See `:help lualine.txt`
|
|
|
|
|
opts = {
|
|
|
|
|
options = {
|
|
|
|
|
icons_enabled = false,
|
|
|
|
|
icons_enabled = true,
|
|
|
|
|
theme = 'onedark',
|
|
|
|
|
component_separators = '|',
|
|
|
|
|
section_separators = '',
|
|
|
|
@ -210,8 +213,8 @@ require('lazy').setup({
|
|
|
|
|
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart
|
|
|
|
|
-- These are some example plugins that I've included in the kickstart repository.
|
|
|
|
|
-- Uncomment any of the lines below to enable them.
|
|
|
|
|
-- require 'kickstart.plugins.autoformat',
|
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
|
require 'kickstart.plugins.autoformat',
|
|
|
|
|
require 'kickstart.plugins.debug',
|
|
|
|
|
|
|
|
|
|
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
|
|
|
|
-- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping
|
|
|
|
@ -219,7 +222,7 @@ require('lazy').setup({
|
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
|
--
|
|
|
|
|
-- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins
|
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
|
}, {})
|
|
|
|
|
|
|
|
|
|
-- [[ Setting options ]]
|
|
|
|
@ -387,6 +390,27 @@ vim.defer_fn(function()
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
end, 0)
|
|
|
|
|
-- Nvim-Tree keymaps
|
|
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>t', ':NvimTreeToggle<CR>', { desc = 'Toggle File Tree' })
|
|
|
|
|
|
|
|
|
|
-- Terminal Keymaps
|
|
|
|
|
function OpenNewTerminalWithAdjustedHeight(height)
|
|
|
|
|
vim.cmd(':bo new')
|
|
|
|
|
vim.cmd(':term')
|
|
|
|
|
vim.cmd(':resize' .. height)
|
|
|
|
|
vim.cmd('wincmd w')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
vim.keymap.set('n', '<leader>T', ':lua OpenNewTerminalWithAdjustedHeight(20)<CR>', { desc = 'Open new terminal' })
|
|
|
|
|
vim.keymap.set('t', '<esc>', '<C-\\><C-N>', { desc = 'Exit terminal mode' })
|
|
|
|
|
vim.keymap.set('n', '|', ':vsplit new | terminal<CR>', { desc = 'Split Terminal' })
|
|
|
|
|
vim.keymap.set('t', '<C-c>', '<C-c><CR>', { desc = 'terminate running command' })
|
|
|
|
|
-- Moving Windows Keymaps
|
|
|
|
|
vim.keymap.set('n', '<C-h>', '<C-w>h', { desc = 'Move to the window to the left' })
|
|
|
|
|
vim.keymap.set('n', '<C-l>', '<C-w>l', { desc = 'Move to the window to the right' })
|
|
|
|
|
vim.keymap.set('n', '<C-k>', '<C-w>k', { desc = 'Move to the window above' })
|
|
|
|
|
vim.keymap.set('n', '<C-j>', '<C-w>j', { desc = 'Move to the window below' })
|
|
|
|
|
|
|
|
|
|
-- Diagnostic keymaps
|
|
|
|
|
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous diagnostic message' })
|
|
|
|
@ -460,11 +484,11 @@ require('which-key').register({
|
|
|
|
|
-- define the property 'filetypes' to the map in question.
|
|
|
|
|
local servers = {
|
|
|
|
|
-- clangd = {},
|
|
|
|
|
-- gopls = {},
|
|
|
|
|
-- pyright = {},
|
|
|
|
|
gopls = {},
|
|
|
|
|
pyright = {},
|
|
|
|
|
-- rust_analyzer = {},
|
|
|
|
|
-- tsserver = {},
|
|
|
|
|
-- html = { filetypes = { 'html', 'twig', 'hbs'} },
|
|
|
|
|
tsserver = {},
|
|
|
|
|
html = { filetypes = { 'html', 'twig', 'hbs' } },
|
|
|
|
|
|
|
|
|
|
lua_ls = {
|
|
|
|
|
Lua = {
|
|
|
|
|