add old files

This commit is contained in:
Josue Zamudio Estrada
2024-03-02 05:13:28 -08:00
parent 2ea1d0c890
commit 04696d3f0b
14 changed files with 625 additions and 0 deletions

29
nvim/init.lua Normal file
View File

@@ -0,0 +1,29 @@
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
"--branch=stable", -- latest stable release
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require('lazy').setup('plugins')
-- Settings
vim.cmd('source ~/.config/nvim/settings.vim')
-- colorscheme
vim.o.termguicolors = true
vim.o.background = "dark" -- or "light" for light mode
vim.cmd("colorscheme gruvbox ")
-- keymaps
vim.keymap.set('n', '<leader>/', ':nohlsearch<CR>')
vim.keymap.set('n', '<leader>b', ':buffers<CR>')
vim.keymap.set('n', 'bp', ':bp<CR>')
vim.keymap.set('n', 'bn', ':bn<CR>')

24
nvim/lazy-lock.json Normal file
View File

@@ -0,0 +1,24 @@
{
"LuaSnip": { "branch": "master", "commit": "f3b3d3446bcbfa62d638b1903ff00a78b2b730a1" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "5af77f54de1b16c34b23cba810150689a3a90312" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"friendly-snippets": { "branch": "main", "commit": "5cc1f45c6aac699ad008fb85f6ae03236062667d" },
"gruvbox.nvim": { "branch": "main", "commit": "6e4027ae957cddf7b193adfaec4a8f9e03b4555f" },
"harpoon": { "branch": "master", "commit": "ccae1b9bec717ae284906b0bf83d720e59d12b91" },
"lazy.nvim": { "branch": "main", "commit": "aedcd79811d491b60d0a6577a9c1701063c2a609" },
"lsp-zero.nvim": { "branch": "v2.x", "commit": "9a686513eaaa13d737d0fec8956a18268ead8b29" },
"lualine.nvim": { "branch": "master", "commit": "7d131a8d3ba5016229e8a1d08bf8782acea98852" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "fe4cce44dec93c69be17dad79b21de867dde118a" },
"mason.nvim": { "branch": "main", "commit": "c43eeb5614a09dc17c03a7fb49de2e05de203924" },
"neorg": { "branch": "main", "commit": "1ab15f4b30627fd5e6dd175a23c7360c2c08b2bd" },
"nvim-cmp": { "branch": "main", "commit": "04e0ca376d6abdbfc8b52180f8ea236cbfddf782" },
"nvim-lspconfig": { "branch": "master", "commit": "114bf1875c4adef7c39c86ef538246478b4af87c" },
"nvim-treesitter": { "branch": "master", "commit": "bdaa6b817aaef459e2d1968c50ce0061e51410e8" },
"nvim-web-devicons": { "branch": "master", "commit": "7f30f2da3c3641841ceb0e2c150281f624445e8f" },
"plenary.nvim": { "branch": "master", "commit": "4f71c0c4a196ceb656c824a70792f3df3ce6bb6d" },
"telescope.nvim": { "branch": "master", "commit": "776b509f80dd49d8205b9b0d94485568236d1192" },
"vimtex": { "branch": "master", "commit": "9df79e15bf035d1cfb32c11fffed38dd7b6a0501" }
}

View File

@@ -0,0 +1,29 @@
return {
"ellisonleao/gruvbox.nvim",
priority = 1000,
config = function ()
require("gruvbox").setup({
undercurl = true,
underline = true,
bold = true,
italic = {
strings = true,
comments = true,
operators = false,
folds = true,
},
strikethrough = true,
invert_selection = false,
invert_signs = false,
invert_tabline = false,
invert_intend_guides = false,
inverse = true, -- invert background for search, diffs, statuslines and errors
contrast = "soft", -- can be "hard", "soft" or empty string
palette_overrides = {},
overrides = {},
dim_inactive = false,
transparent_mode = false,
})
end
}

View File

@@ -0,0 +1,23 @@
return {
'ThePrimeagen/harpoon',
config = function(_, opts)
require('harpoon').setup(opts)
local mark = require('harpoon'.. ".mark")
local ui = require('harpoon'.. ".ui")
-- Harpoon marked files 1 through 4.
vim.keymap.set("n", "<a-1>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<a-2>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<a-3>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<a-4>", function() ui.nav_file(4) end)
-- Harpoon next and previous.
vim.keymap.set("n", "<a-n>", function() ui.nav_next() end)
vim.keymap.set("n", "<a-p>", function() ui.nav_prev() end)
-- Harpoon user interface.
vim.keymap.set("n", "<leader>hq", ui.toggle_quick_menu)
vim.keymap.set("n", "<leader>ha", mark.add_file)
end
}

View File

@@ -0,0 +1,81 @@
return {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
dependencies = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{'williamboman/mason.nvim'}, -- Optional
{'williamboman/mason-lspconfig.nvim'}, -- Optional
-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'hrsh7th/cmp-buffer'}, -- Optional
{'hrsh7th/cmp-path'}, -- Optional
{'saadparwaiz1/cmp_luasnip'}, -- Optional
{'hrsh7th/cmp-nvim-lua'}, -- Optional
-- snippets
{'L3MON4D3/LuaSnip'}, -- Required
{'rafamadriz/friendly-snippets'}, -- Optional
},
config = function()
local lsp = require('lsp-zero')
lsp.preset('recommended')
lsp.on_attach(function(client, bufnr)
local opts = {buffer = bufnr, remap = false}
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>ca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>rr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>rn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
local lspconfig = require('lspconfig')
local root_pattern = require('lspconfig.util').root_pattern
lspconfig['jedi_language_server'].setup{
root_dir = root_pattern('.git', 'setup.py')
}
lspconfig['lua_ls'].setup{
settings = {
Lua = {
diagnostics = {
-- Get the language server to recognize the `vim` global
globals = {'vim'},
},
},
},
}
local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
require('luasnip.loaders.from_vscode').lazy_load()
cmp.setup({
mapping = {
['<CR>'] = cmp.mapping.confirm({select = false}),
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
},
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body)
end
},
})
lsp.setup()
end
}

View File

@@ -0,0 +1,46 @@
return{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons', opt = true },
config = function()
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}
end
}

View File

@@ -0,0 +1,21 @@
return {
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = { "nvim-lua/plenary.nvim" },
config = function()
require("neorg").setup {
load = {
["core.defaults"] = {}, -- Loads default behaviour
["core.summary"] = {},
["core.concealer"] = {}, -- Adds pretty icons to your documents
["core.dirman"] = { -- Manages Neorg workspaces
config = {
workspaces = {
work = "/mnt/c/Users/Josue/Documents/SLAC/notes/"
},
},
},
},
}
end
}

View File

@@ -0,0 +1,20 @@
return {
'nvim-telescope/telescope.nvim', tag = '0.1.2',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function()
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
require('telescope').setup{
pickers = {
find_files = {
theme = "dropdown",
}
}
}
end
}

View File

@@ -0,0 +1,46 @@
return {
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
require("nvim-treesitter.configs").setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "python", "bash", "make" },
-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,
-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,
-- List of parsers to ignore installing (for "all")
ignore_install = { "javascript" },
---- If you need to change the installation directory of the parsers (see -> Advanced Setup)
-- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")!
highlight = {
enable = true,
-- NOTE: these are the names of the parsers and not the filetype. (for example if you want to
-- disable highlighting for the `tex` filetype, you need to include `latex` in this list as this is
-- the name of the parser)
-- list of language that will be disabled
-- disable = { "c", "rust" },
-- Or use a function for more flexibility, e.g. to disable slow treesitter highlight for large files
disable = function(lang, buf)
local max_filesize = 100 * 1024 -- 100 KB
local ok, stats = pcall(vim.loop.fs_stat, vim.api.nvim_buf_get_name(buf))
if ok and stats and stats.size > max_filesize then
return true
end
end,
-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
end }

View File

@@ -0,0 +1,18 @@
return{
'lervag/vimtex',
config = function()
-- This is necessary for VimTeX to load properly. The "indent" is optional.
-- Note that most plugin managers will do this automatically.
vim.cmd("filetype plugin indent on")
-- This enables Vim's and neovim's syntax-related features. Without this, some
-- VimTeX features will not work (see ":help vimtex-requirements" for more
--info).
vim.cmd("syntax enable")
-- Viewer options: One may configure the viewer either by specifying a built-in
-- viewer method:
vim.cmd("let g:vimtex_view_method = 'zathura'")
end,
}

120
nvim/settings.vim Normal file
View File

@@ -0,0 +1,120 @@
set secure " secure modeline processing
set nocompatible " use modern vim, not vi stuff
" mapleader is the key to be used for plugins and other mappings that have
" <Leader> used in them. You're free to change it, but I've found that space
" works rather well:
"let mapleader="\<Space>" " prefix when using <leader> in map
" If you'd like your working directory to change depending on the file you
" open, use 'set acd':
" set acd " current directory follows file being edited
" Otherwise, use the default we provide here:
set noacd " current directory does not follow file being edited
set autoindent " always set autoindenting on
set backspace=2 whichwrap+=<,>,[,] " backspace and cursor keys wrap to previous/next line
set expandtab " tabs -> spaces (use :retab to force a conversion)
set foldlevel=99
set foldmethod=indent
set guioptions=cmgtTr
set history=500 " keep x lins of command line history
set hlsearch " highlight things you've searched for
set ignorecase smartcase " case-insensitive (ic) search by default (-> noic is the opposite)
" except: if you search for AStringLikeThis, it will be case sensitive
set imdisable " Disable the IME (gvim and unicode don't play well on different locale)
set incsearch " do incremental searching
set nobackup " disable writing .bak
set novb " ** visual bell, no beeping! **
set number " line numbering
set numberwidth=5 " the width of the number column in characters
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set smartindent " smartindent when starting new line
set tabstop=4 shiftwidth=4 autoindent " 4 spaces per tab
set undofile " use undo files to undo your work
set undolevels=10000 " keep this many undo steps available
set undoreload=20000
set wrap " wrap text at the end of your screen (-> nowrap)
" Don't show files that match these for tab completion
set wildignore+=*/tmp/*,*.so,*.swp,*.zip
set wildignore+=*\\tmp\\*,*.exe
" Enable filetype detection, plugins, and indentation
" Scripts used by this may be customized or they fall back to those
" defined at the system level: /usr/share/vim/
" Example paths below are from psbuild-rhel7.
" The actual full search path can be found with a ``:set runtimepath``.
"
" - filetype: detect the type of file you are editing
" - plugin: enable plugins based on file type
" See for example: /usr/share/vim/vim74/ftplugin/python.vim
" - indent: load indent settings on a per-filetype basis
" See for example: /usr/share/vim/vim74/indent/python.vim
filetype plugin indent on
" Enable syntax highlighting
syntax on
" Don't use Ex mode, use Q for formatting
" If you don't know what it is, Ex mode is likely just going to confuse you.
" I would recommend keeping this setting mapping Q to something else.
map Q gq
" Python settings. With filetype detection on, these settings will be used
" for all .py files.
au FileType python
\ set tabstop=4
\ softtabstop=4
\ shiftwidth=4
\ textwidth=79
\ expandtab
\ autoindent
\ fileformat=unix
\ encoding=utf-8
\ makeprg=flake8\ %
" General settings for shell/vim scripts, c++, etc.
au FileType sh,vim,cpp,yaml
\ set tabstop=2
\ softtabstop=2
\ shiftwidth=2
\ expandtab
\ autoindent
" Show bad whitespace in an obvious but not obnoxious color
highlight pythonSpaceError ctermbg=darkgreen guibg=darkgreen
highlight BadWhitespace ctermbg=darkgreen guibg=darkgreen
au BufNewFile,BufRead *.py,*.pyw,*.c,*.h,*.cc,*.hh,*.sh match BadWhitespace /\s\+$/
set showmatch
set ruler
set wrap
set showbreak=↳\ \
set textwidth=80
set colorcolumn=-2
set autoindent
set smartindent
set expandtab
set wildmenu
set showcmd
set mouse=
set clipboard+=unnamedplus
" set backup, undo, and swap?
let &directory = expand('~/.vimdata/swap/')
set backup
let &backupdir = expand('~/.vimdata/backup/')
set undofile
let &undodir = expand('~/.vimdata/undo/')
if !isdirectory(&undodir) | call mkdir(&undodir, "p") | endif
if !isdirectory(&backupdir) | call mkdir(&backupdir, "p") | endif
if !isdirectory(&directory) | call mkdir(&directory, "p") | endif
set pumheight=20 " keep the autocomplete suggestion menu small
set shortmess+=c " don't give ins-completion-menu messages