parent
5d486635a8
commit
87c55d3dc1
120
init.lua
120
init.lua
|
@ -15,13 +15,16 @@ vim.g.have_nerd_font = true
|
|||
-- Make line numbers default and set relativenumbers
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.relativenumber = true
|
||||
-- Enable mouse mode, can be useful for resizing splits for example!
|
||||
vim.opt.mouse = 'a'
|
||||
|
||||
-- Don't show the mode, since it's already in the status line
|
||||
vim.opt.showmode = false
|
||||
|
||||
-- Disable search count/select count etc. in bottom right corner
|
||||
vim.opt.showcmd = false
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
-- Schedule the setting after `UiEnter` because it can increase startup-time.
|
||||
-- Remove this option if you want your OS clipboard to remain independent.
|
||||
|
@ -146,74 +149,6 @@ vim.opt.rtp:prepend(lazypath)
|
|||
--
|
||||
-- NOTE: Here is where you install your plugins.
|
||||
require('lazy').setup({
|
||||
{
|
||||
'krivahtoo/silicon.nvim',
|
||||
build = 'install.sh | silicon',
|
||||
init = function()
|
||||
os.execute 'silicon --build-cache'
|
||||
end,
|
||||
config = function()
|
||||
local silicon = require 'silicon'
|
||||
silicon.setup {
|
||||
font = 'FiraCode Nerd Font Mono',
|
||||
theme = 'Catppuccin-Macchiato',
|
||||
}
|
||||
end,
|
||||
},
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
opts = {},
|
||||
cmd = 'Trouble',
|
||||
keys = {
|
||||
{
|
||||
'<leader>xx',
|
||||
'<cmd>Trouble diagnostics toggle<cr>',
|
||||
desc = 'Diagnostics (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>xX',
|
||||
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
|
||||
desc = 'Buffer Diagnostics (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>cs',
|
||||
'<cmd>Trouble symbols toggle focus=false<cr>',
|
||||
desc = 'Symbols (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>cl',
|
||||
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
|
||||
desc = 'LSP Definitions / references / ... (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>xL',
|
||||
'<cmd>Trouble loclist toggle<cr>',
|
||||
desc = 'Location List (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>xQ',
|
||||
'<cmd>Trouble qflist toggle<cr>',
|
||||
desc = 'Quickfix List (Trouble)',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
'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>' },
|
||||
},
|
||||
},
|
||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||
|
||||
|
@ -297,10 +232,9 @@ require('lazy').setup({
|
|||
F12 = '<F12>',
|
||||
},
|
||||
},
|
||||
|
||||
-- Document existing key chains
|
||||
spec = {
|
||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' } },
|
||||
{ '<leader>c', group = '[C]ode', mode = { 'n', 'x' }, },
|
||||
{ '<leader>d', group = '[D]ocument' },
|
||||
{ '<leader>r', group = '[R]ename' },
|
||||
{ '<leader>s', group = '[S]earch' },
|
||||
|
@ -396,12 +330,12 @@ require('lazy').setup({
|
|||
vim.keymap.set('n', '<leader>sf', 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>sw', 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>sp', builtin.live_grep, { desc = '[S]earch by gre[p]' })
|
||||
vim.keymap.set('n', '<leader>sd', 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>s.', 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>sp', builtin.git_files, { desc = '[S]earch [P]roject' })
|
||||
vim.keymap.set('n', '<leader>sg', builtin.git_files, { desc = '[S]earch [P]roject' })
|
||||
vim.keymap.set('n', '<leader>u', '<cmd> Telescope undo<cr>', { desc = '[u]ndo' })
|
||||
|
||||
-- Slightly advanced example of overriding default behavior and theme
|
||||
|
@ -779,12 +713,6 @@ require('lazy').setup({
|
|||
-- This will expand snippets if the LSP sent a snippet.
|
||||
['<C-y>'] = 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.
|
||||
|
@ -844,7 +772,7 @@ require('lazy').setup({
|
|||
},
|
||||
|
||||
-- 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 = true } },
|
||||
|
||||
{ -- Collection of various small independent plugins/modules
|
||||
'echasnovski/mini.nvim',
|
||||
|
@ -863,24 +791,6 @@ require('lazy').setup({
|
|||
-- - sd' - [S]urround [D]elete [']quotes
|
||||
-- - sr)' - [S]urround [R]eplace [)] [']
|
||||
require('mini.surround').setup()
|
||||
|
||||
-- Simple and easy statusline.
|
||||
-- You could remove this setup call if you don't like it,
|
||||
-- and try some other statusline plugin
|
||||
local statusline = require 'mini.statusline'
|
||||
-- set use_icons to true if you have a Nerd Font
|
||||
statusline.setup { use_icons = vim.g.have_nerd_font }
|
||||
|
||||
-- You can configure sections in the statusline by overriding their
|
||||
-- default behavior. For example, here we set the section for
|
||||
-- cursor location to LINE:COLUMN
|
||||
---@diagnostic disable-next-line: duplicate-set-field
|
||||
statusline.section_location = function()
|
||||
return '%2l:%-2v'
|
||||
end
|
||||
|
||||
-- ... and there is more!
|
||||
-- Check out: https://github.com/echasnovski/mini.nvim
|
||||
end,
|
||||
},
|
||||
{ -- Highlight, edit, and navigate code
|
||||
|
@ -926,28 +836,22 @@ require('lazy').setup({
|
|||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
},
|
||||
|
||||
-- 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.
|
||||
|
||||
-- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart
|
||||
--
|
||||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.neo-tree',
|
||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
-- require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
-- require 'kickstart.plugins.neo-tree',
|
||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
-- This is the easiest way to modularize your config.
|
||||
--
|
||||
-- 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`
|
||||
-- { import = 'custom.plugins' },
|
||||
{ import = 'custom.plugins' },
|
||||
}, {
|
||||
ui = {
|
||||
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
return {
|
||||
{ 'tpope/vim-fugitive' }
|
||||
}
|
|
@ -2,4 +2,20 @@
|
|||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return {}
|
||||
return {
|
||||
-- Doesn't work on windows sometimes so it's commented out
|
||||
-- {
|
||||
-- 'krivahtoo/silicon.nvim',
|
||||
-- build = 'install.sh | silicon',
|
||||
-- init = function()
|
||||
-- os.execute 'silicon --build-cache'
|
||||
-- end,
|
||||
-- config = function()
|
||||
-- local silicon = require 'silicon'
|
||||
-- silicon.setup {
|
||||
-- font = 'FiraCode Nerd Font Mono',
|
||||
-- theme = 'Catppuccin-Macchiato',
|
||||
-- }
|
||||
-- end,
|
||||
-- },
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
return {
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
opts = {
|
||||
theme = 'catppuccin',
|
||||
sections = {
|
||||
-- Left
|
||||
lualine_a = {
|
||||
{
|
||||
'datetime',
|
||||
style = '%b %d %Y (%A) 🕙 %H:%M'
|
||||
},
|
||||
'mode',
|
||||
},
|
||||
lualine_b = {
|
||||
{
|
||||
'buffers',
|
||||
hide_filename_extension = true,
|
||||
mode = 2,
|
||||
use_mode_colors = true
|
||||
}
|
||||
},
|
||||
lualine_c = { 'diff', 'diagnostics' },
|
||||
-- Right
|
||||
lualine_x = { 'encoding', 'fileformat', 'filename', 'filetype' },
|
||||
lualine_y = { 'searchcount', 'selectioncount' },
|
||||
lualine_z = { 'location', 'progress' },
|
||||
},
|
||||
-- extensions = { 'trouble' }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
return {
|
||||
{
|
||||
'folke/trouble.nvim',
|
||||
opts = {},
|
||||
cmd = 'Trouble',
|
||||
keys = {
|
||||
{
|
||||
'<leader>dd',
|
||||
'<cmd>Trouble diagnostics toggle<cr>',
|
||||
desc = 'Diagnostics (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>dD',
|
||||
'<cmd>Trouble diagnostics toggle filter.buf=0<cr>',
|
||||
desc = 'Buffer Diagnostics (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>ts',
|
||||
'<cmd>Trouble symbols toggle focus=false<cr>',
|
||||
desc = '[T]oggle Document Symbols (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>tl',
|
||||
'<cmd>Trouble lsp toggle focus=false win.position=right<cr>',
|
||||
desc = '[T]oggle [L]SP Definitions / references / ... (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>tL',
|
||||
'<cmd>Trouble loclist toggle<cr>',
|
||||
desc = '[T]oggle [L]ocation List (Trouble)',
|
||||
},
|
||||
{
|
||||
'<leader>tQ',
|
||||
'<cmd>Trouble qflist toggle<cr>',
|
||||
desc = '[T]oggle [Q]uickfix List (Trouble)',
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
return {
|
||||
{
|
||||
'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>' },
|
||||
},
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue