santi setup

This commit is contained in:
ojedasodev 2024-08-26 13:06:05 -05:00
parent 1860184830
commit 732d726e7b
5 changed files with 199 additions and 104 deletions

181
init.lua
View File

@ -1,97 +1,41 @@
--[[
=====================================================================
==================== READ THIS BEFORE CONTINUING ====================
=====================================================================
======== .-----. ========
======== .----------------------. | === | ========
======== |.-""""""""""""""""""-.| |-----| ========
======== || || | === | ========
======== || KICKSTART.NVIM || |-----| ========
======== || || | === | ========
======== || || |-----| ========
======== ||:Tutor || |:::::| ========
======== |'-..................-'| |____o| ========
======== `"")----------------(""` ___________ ========
======== /::::::::::| |::::::::::\ \ no mouse \ ========
======== /:::========| |==hjkl==:::\ \ required \ ========
======== '""""""""""""' '""""""""""""' '""""""""""' ========
======== ========
=====================================================================
=====================================================================
What is Kickstart?
Kickstart.nvim is *not* a distribution.
Kickstart.nvim is a starting point for your own configuration.
The goal is that you can read every line of code, top-to-bottom, understand
what your configuration is doing, and modify it to suit your needs.
Once you've done that, you can start exploring, configuring and tinkering to
make Neovim your own! That might mean leaving Kickstart just the way it is for a while
or immediately breaking it into modular pieces. It's up to you!
If you don't know anything about Lua, I recommend taking some time to read through
a guide. One possible example which will only take 10-15 minutes:
- https://learnxinyminutes.com/docs/lua/
After understanding a bit more about Lua, you can use `:help lua-guide` as a
reference for how Neovim integrates Lua.
- :help lua-guide
- (or HTML version): https://neovim.io/doc/user/lua-guide.html
Kickstart Guide:
TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
If you don't know what this means, type the following:
- <escape key>
- :
- Tutor
- <enter key>
(If you already know the Neovim basics, you can skip this step.)
Once you've completed that, you can continue working through **AND READING** the rest
of the kickstart init.lua.
Next, run AND READ `:help`.
This will open up a help window with some basic information
about reading, navigating and searching the builtin help documentation.
This should be the first place you go to look when you're stuck or confused
with something. It's one of my favorite Neovim features.
MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
which is very useful when you're not exactly sure of what you're looking for.
I have left several `:help X` comments throughout the init.lua
These are hints about where to find more information about the relevant settings,
plugins or Neovim features used in Kickstart.
NOTE: Look for lines like this
Throughout the file. These are for you, the reader, to help you understand what is happening.
Feel free to delete them once you know what you're doing, but they should serve as a guide
for when you are first encountering a few different constructs in your Neovim config.
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
I hope you enjoy your Neovim journey,
- TJ
P.S. You can delete this when you're done too. It's your config now! :)
--]]
-- Set <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Encoding
vim.scriptencoding = 'utf-8'
vim.opt.encoding = 'utf-8'
vim.opt.fileencoding = 'utf-8'
vim.opt.title = true
vim.opt.autoindent = true
vim.opt.smartindent = true
vim.opt.hlsearch = true
vim.opt.backup = false
vim.opt.showcmd = true
vim.opt.cmdheight = 0
vim.opt.laststatus = 0
vim.opt.expandtab = true
vim.opt.smarttab = true
vim.opt.shiftwidth = 2
vim.opt.tabstop = 2
vim.opt.wrap = false
vim.opt.backspace = { 'start', 'eol', 'indent' }
vim.opt.path:append { '**' } -- Finding files - Search down into subfolders
vim.opt.wildignore:append { '*/node_modules/*' }
vim.opt.splitkeep = 'cursor'
-- 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
-- disable netrw at the very start of your init.lua
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- optionally enable 24-bit colour
vim.opt.termguicolors = true
-- [[ Setting options ]]
-- See `:help vim.opt`
@ -102,10 +46,10 @@ 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'
vim.opt.mouse = ''
-- Don't show the mode, since it's already in the status line
vim.opt.showmode = false
@ -158,12 +102,20 @@ vim.opt.cursorline = true
vim.opt.scrolloff = 10
-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`
-- See `:help vim.keymap.set()
-- Clear highlights on search when pressing <Esc> in normal mode
-- See `:help hlsearch`
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
-- keymap for escape in insert mode
vim.keymap.set('i', 'jj', '<Esc>')
-- keymap for save files
vim.keymap.set('n', '<leader>wg', ':w<CR>', { desc = 'Save file' })
-- keymap for quit files
vim.keymap.set('n', '<leader>wq', ':q!<CR>', { desc = 'Quit file' })
-- Diagnostic keymaps
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
@ -180,7 +132,7 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
--
-- Keybinds to make split navigation easier.
-- Use CTRL+<hjkl> to switch between windows
--
@ -247,11 +199,12 @@ require('lazy').setup({
'lewis6991/gitsigns.nvim',
opts = {
signs = {
add = { text = '+' },
change = { text = '~' },
add = { text = '' },
change = { text = '' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
untracked = { text = '' },
},
},
},
@ -303,6 +256,7 @@ require('lazy').setup({
branch = '0.1.x',
dependencies = {
'nvim-lua/plenary.nvim',
'debugloop/telescope-undo.nvim',
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
'nvim-telescope/telescope-fzf-native.nvim',
@ -352,17 +306,21 @@ require('lazy').setup({
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
-- },
-- },
-- pickers = {}
-- pickers = {},
extensions = {
['ui-select'] = {
require('telescope.themes').get_dropdown(),
},
['undo'] = {
require('telescope.themes').get_dropdown(),
},
},
}
-- Enable Telescope extensions if they are installed
pcall(require('telescope').load_extension, 'fzf')
pcall(require('telescope').load_extension, 'ui-select')
pcall(require('telescope').load_extension, 'undo')
-- See `:help telescope.builtin`
local builtin = require 'telescope.builtin'
@ -376,6 +334,7 @@ require('lazy').setup({
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>u', '<cmd>Telescope undo<cr>', { desc = 'Search in [u]ndo tree' })
-- Slightly advanced example of overriding default behavior and theme
vim.keymap.set('n', '<leader>/', function()
@ -569,9 +528,9 @@ require('lazy').setup({
-- - 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/
local servers = {
-- clangd = {},
clangd = {},
-- gopls = {},
-- pyright = {},
pyright = {},
-- rust_analyzer = {},
-- ... etc. See `:help lspconfig-all` for a list of all the pre-configured LSPs
--
@ -579,7 +538,7 @@ require('lazy').setup({
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`tsserver`) will work just fine
-- tsserver = {},
tsserver = {},
--
lua_ls = {
@ -793,7 +752,7 @@ require('lazy').setup({
-- 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'
vim.cmd.colorscheme 'habamax'
-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
@ -818,9 +777,25 @@ require('lazy').setup({
--
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
-- - sd' - [S]urround [D]elete [']quotes
-- - sr)' - [S]urround [R]eplace [)] [']
-- -dsr)' - [S]urround [R]eplace [)] [']
require('mini.surround').setup()
require('mini.pairs').setup {
event = 'VeryLazy',
opts = {
modes = { insert = true, command = true, terminal = false },
-- skip autopair when next character is one of these
skip_next = [=[[%w%%%'%[%"%.%`%$]]=],
-- skip autopair when the cursor is inside these treesitter nodes
skip_ts = { 'string' },
-- skip autopair when next character is closing pair
-- and there are more closing pairs than opening pairs
skip_unbalanced = true,
-- better deal with markdown code blocks
markdown = true,
},
}
-- Simple and easy statusline.
-- You could remove this setup call if you don't like it,
-- and try some other statusline plugin
@ -884,15 +859,15 @@ require('lazy').setup({
-- 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
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

9
lazyvim.json Normal file
View File

@ -0,0 +1,9 @@
{
"extras": [
],
"news": {
"NEWS.md": "6520"
},
"version": 6
}

7
lua/config/keybinds.lua Normal file
View File

@ -0,0 +1,7 @@
local keymap = vim.keymap
local opts = { noremap = true, silent = true }
keymap.set('n', '+', '<C-a>')
keymap.set('n', '-', '<C-x>')
keymap.set('n', '<C-a>', 'gg<S-v>G')

View File

@ -2,4 +2,98 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
local ts_comments = {
'folke/ts-comments.nvim',
event = 'VeryLazy',
opts = {},
}
local nvim_ts_autotag = {
'windwp/nvim-ts-autotag',
opts = {},
}
local codeium = {
'Exafunction/codeium.vim',
event = 'BufEnter',
}
local noice = {
'folke/noice.nvim',
event = 'VeryLazy',
dependencies = {
'MunifTanjim/nui.nvim',
'rcarriga/nvim-notify',
},
config = function()
require('noice').setup {
lsp = {
-- override markdown rendering so that **cmp** and other plugins use **Treesitter**
override = {
['vim.lsp.util.convert_input_to_markdown_lines'] = true,
['vim.lsp.util.stylize_markdown'] = true,
['cmp.entry.get_documentation'] = true, -- requires hrsh7th/nvim-cmp
},
},
-- you can enable a preset for easier configuration
presets = {
bottom_search = true, -- use a classic bottom cmdline for search
command_palette = true, -- position the cmdline and popupmenu together
long_message_to_split = true, -- long messages will be sent to a split
inc_rename = false, -- enables an input dialog for inc-rename.nvim
lsp_doc_border = false, -- add a border to hover docs and signature help
},
}
end,
}
local troble = {
'folke/trouble.nvim',
cmd = { 'Trouble' },
opts = {
modes = {
lsp = {
win = { position = 'right' },
},
},
},
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<cr>', desc = 'Symbols (Trouble)' },
{ '<leader>cS', '<cmd>Trouble lsp toggle<cr>', desc = 'LSP references/definitions/... (Trouble)' },
{ '<leader>xL', '<cmd>Trouble loclist toggle<cr>', desc = 'Location List (Trouble)' },
{ '<leader>xQ', '<cmd>Trouble qflist toggle<cr>', desc = 'Quickfix List (Trouble)' },
{
'[q',
function()
if require('trouble').is_open() then
require('trouble').prev { skip_groups = true, jump = true }
else
local ok, err = pcall(vim.cmd.cprev)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = 'Previous Trouble/Quickfix Item',
},
{
']q',
function()
if require('trouble').is_open() then
require('trouble').next { skip_groups = true, jump = true }
else
local ok, err = pcall(vim.cmd.cnext)
if not ok then
vim.notify(err, vim.log.levels.ERROR)
end
end
end,
desc = 'Next Trouble/Quickfix Item',
},
},
}
return { codeium, noice, troble, nvim_ts_autotag, ts_comments }

View File

@ -12,6 +12,13 @@ return {
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal' },
{
'<leader>ge',
function()
require('neo-tree.command').execute { source = 'git_status', toggle = true }
end,
desc = 'Git Explorer',
},
},
opts = {
filesystem = {
@ -22,4 +29,7 @@ return {
},
},
},
config = function(_, opts)
require('neo-tree').setup(opts)
end,
}