restoring files

pull/341/head^2
Andres 2 years ago
parent 982b18195e
commit c2b5078e3e

@ -1,5 +1,4 @@
--[[ --[[
===================================================================== =====================================================================
==================== READ THIS BEFORE CONTINUING ==================== ==================== READ THIS BEFORE CONTINUING ====================
===================================================================== =====================================================================
@ -35,7 +34,6 @@ I hope you enjoy your Neovim journey,
P.S. You can delete this when you're done too. It's your config now :) P.S. You can delete this when you're done too. It's your config now :)
--]] --]]
-- Set <space> as the leader key -- Set <space> as the leader key
-- See `:help mapleader` -- See `:help mapleader`
-- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) -- NOTE: Must happen before plugins are required (otherwise wrong leader will be used)
@ -75,11 +73,12 @@ require('lazy').setup({
-- NOTE: This is where your plugins related to LSP can be installed. -- NOTE: This is where your plugins related to LSP can be installed.
-- The configuration is done below. Search for lspconfig to find it below. -- The configuration is done below. Search for lspconfig to find it below.
{ -- LSP Configuration & Plugins {
-- LSP Configuration & Plugins
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
-- Automatically install LSPs to stdpath for neovim -- Automatically install LSPs to stdpath for neovim
{ 'williamboman/mason.nvim', config = true }, 'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
-- Useful status updates for LSP -- Useful status updates for LSP
@ -91,14 +90,16 @@ require('lazy').setup({
}, },
}, },
{ -- Autocompletion {
-- Autocompletion
'hrsh7th/nvim-cmp', 'hrsh7th/nvim-cmp',
dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' }, dependencies = { 'hrsh7th/cmp-nvim-lsp', 'L3MON4D3/LuaSnip', 'saadparwaiz1/cmp_luasnip' },
}, },
-- Useful plugin to show you pending keybinds. -- Useful plugin to show you pending keybinds.
{ 'folke/which-key.nvim', opts = {} }, { 'folke/which-key.nvim', opts = {} },
{ -- Adds git releated signs to the gutter, as well as utilities for managing changes {
-- Adds git releated signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
opts = { opts = {
-- See `:help gitsigns.txt` -- See `:help gitsigns.txt`
@ -111,40 +112,63 @@ require('lazy').setup({
}, },
}, },
}, },
-- {
{ -- Theme inspired by Atom -- 'rebelot/kanagawa.nvim',
'navarasu/onedark.nvim', -- priority = 1000,
-- config = function()
-- vim.cmd.colorscheme 'kanagawa'
-- end,
-- },
-- {
-- 'ellisonleao/gruvbox.nvim',
-- priority = 1000,
-- config = function()
-- vim.cmd.colorscheme 'gruvbox'
-- end,
-- },
-- {
-- -- Theme inspired by Atom
-- 'navarasu/onedark.nvim',
-- priority = 1000,
-- config = function()
-- vim.cmd.colorscheme 'onedark'
-- end,
-- },
{
'rose-pine/neovim',
priority = 1000, priority = 1000,
config = function() config = function()
vim.cmd.colorscheme 'onedark' vim.cmd.colorscheme 'rose-pine-main'
end, end,
}, },
{ -- Set lualine as statusline {
-- Set lualine as statusline
'nvim-lualine/lualine.nvim', 'nvim-lualine/lualine.nvim',
-- See `:help lualine.txt` -- See `:help lualine.txt`
opts = { opts = {
options = { options = {
icons_enabled = false, icons_enabled = false,
theme = 'onedark', theme = 'rose-pine',
component_separators = '|', component_separators = '|',
section_separators = '', section_separators = '',
}, },
}, },
}, },
{ -- Add indentation guides even on blank lines {
-- Add indentation guides even on blank lines
'lukas-reineke/indent-blankline.nvim', 'lukas-reineke/indent-blankline.nvim',
-- Enable `lukas-reineke/indent-blankline.nvim` -- Enable `lukas-reineke/indent-blankline.nvim`
-- See `:help indent_blankline.txt` -- See `:help indent_blankline.txt`
opts = { opts = {
char = '', char = '',
show_trailing_blankline_indent = false, show_trailing_blankline_indent = false,
}, },
}, },
-- "gc" to comment visual regions/lines -- "gc" to comment visual regions/lines
{ 'numToStr/Comment.nvim', opts = {} }, { 'numToStr/Comment.nvim', opts = {} },
-- Fuzzy Finder (files, lsp, etc) -- Fuzzy Finder (files, lsp, etc)
{ 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim' } }, { 'nvim-telescope/telescope.nvim', version = '*', dependencies = { 'nvim-lua/plenary.nvim' } },
@ -162,18 +186,21 @@ require('lazy').setup({
end, end,
}, },
{ -- Highlight, edit, and navigate code {
-- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
dependencies = { dependencies = {
'nvim-treesitter/nvim-treesitter-textobjects', 'nvim-treesitter/nvim-treesitter-textobjects',
}, },
build = ":TSUpdate", config = function()
pcall(require('nvim-treesitter.install').update { with_sync = true })
end,
}, },
-- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- 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. -- These are some example plugins that I've included in the kickstart repository.
-- Uncomment any of the lines below to enable them. -- Uncomment any of the lines below to enable them.
-- require 'kickstart.plugins.autoformat', require 'kickstart.plugins.autoformat',
-- require 'kickstart.plugins.debug', -- require 'kickstart.plugins.debug',
-- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below automatically adds your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
@ -193,9 +220,38 @@ require('lazy').setup({
-- Set highlight on search -- Set highlight on search
vim.o.hlsearch = false vim.o.hlsearch = false
vim.opt.incsearch = true;
-- Make line numbers default -- Make line numbers default
vim.wo.number = true vim.wo.number = true
-- Set relative numbers
vim.wo.relativenumber = true
-- Move highlited line with alt
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv")
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv")
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==")
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==")
-- Greatest remap ever
vim.keymap.set("x", "<A-p>", "\"_dP")
-- /hen searching keep cursor in the middle
vim.keymap.set("n", "n", "nzzzv")
vim.keymap.set("n", "N", "Nzzzv")
-- About quick fixes
-- vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
-- vim.keymap.set("n", "<C-j>", "<cmd>cprev<CR>zz")
vim.keymap.set("n", "<leader>k", "<cmd>lnext<CR>zz")
-- set tab configuration
local set = vim.opt -- set options
set.tabstop = 4
set.softtabstop = 4
set.shiftwidth = 4
set.wrap = false;
set.scrolloff = 8
-- Enable mouse mode -- Enable mouse mode
vim.o.mouse = 'a' vim.o.mouse = 'a'
@ -230,6 +286,8 @@ vim.o.termguicolors = true
-- [[ Basic Keymaps ]] -- [[ Basic Keymaps ]]
vim.keymap.set('n', '<C-s>', ':w<CR>', { silent = true })
vim.keymap.set('n', '<C-b>', ':Neotree toggle<CR>', { desc = 'Toggle Tree', silent = true })
-- Keymaps for better default experience -- Keymaps for better default experience
-- See `:help vim.keymap.set()` -- See `:help vim.keymap.set()`
vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true }) vim.keymap.set({ 'n', 'v' }, '<Space>', '<Nop>', { silent = true })
@ -255,8 +313,8 @@ require('telescope').setup {
defaults = { defaults = {
mappings = { mappings = {
i = { i = {
['<C-u>'] = false, ['<C-u>'] = false,
['<C-d>'] = false, ['<C-d>'] = false,
}, },
}, },
}, },
@ -286,10 +344,10 @@ vim.keymap.set('n', '<leader>sd', require('telescope.builtin').diagnostics, { de
-- See `:help nvim-treesitter` -- See `:help nvim-treesitter`
require('nvim-treesitter.configs').setup { require('nvim-treesitter.configs').setup {
-- Add languages to be installed here that you want installed for treesitter -- Add languages to be installed here that you want installed for treesitter
ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'vimdoc', 'vim' }, ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'typescript', 'help', 'vim' },
-- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!)
auto_install = false, auto_install = true,
highlight = { enable = true }, highlight = { enable = true },
indent = { enable = true, disable = { 'python' } }, indent = { enable = true, disable = { 'python' } },
@ -308,41 +366,41 @@ require('nvim-treesitter.configs').setup {
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
keymaps = { keymaps = {
-- You can use the capture groups defined in textobjects.scm -- You can use the capture groups defined in textobjects.scm
['aa'] = '@parameter.outer', ['aa'] = '@parameter.outer',
['ia'] = '@parameter.inner', ['ia'] = '@parameter.inner',
['af'] = '@function.outer', ['af'] = '@function.outer',
['if'] = '@function.inner', ['if'] = '@function.inner',
['ac'] = '@class.outer', ['ac'] = '@class.outer',
['ic'] = '@class.inner', ['ic'] = '@class.inner',
}, },
}, },
move = { move = {
enable = true, enable = true,
set_jumps = true, -- whether to set jumps in the jumplist set_jumps = true, -- whether to set jumps in the jumplist
goto_next_start = { goto_next_start = {
[']m'] = '@function.outer', [']m'] = '@function.outer',
[']]'] = '@class.outer', [']]'] = '@class.outer',
}, },
goto_next_end = { goto_next_end = {
[']M'] = '@function.outer', [']M'] = '@function.outer',
[']['] = '@class.outer', [']['] = '@class.outer',
}, },
goto_previous_start = { goto_previous_start = {
['[m'] = '@function.outer', ['[m'] = '@function.outer',
['[['] = '@class.outer', ['[['] = '@class.outer',
}, },
goto_previous_end = { goto_previous_end = {
['[M'] = '@function.outer', ['[M'] = '@function.outer',
['[]'] = '@class.outer', ['[]'] = '@class.outer',
}, },
}, },
swap = { swap = {
enable = true, enable = true,
swap_next = { swap_next = {
['<leader>a'] = '@parameter.inner', ['<leader>a'] = '@parameter.inner',
}, },
swap_previous = { swap_previous = {
['<leader>A'] = '@parameter.inner', ['<leader>A'] = '@parameter.inner',
}, },
}, },
}, },
@ -372,7 +430,8 @@ local on_attach = function(_, bufnr)
end end
nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame') nmap('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction') nmap('<leader>ca', ':CodeActionMenu<CR>', '[C]ode [A]ction')
-- nmap('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition') nmap('gd', vim.lsp.buf.definition, '[G]oto [D]efinition')
nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences') nmap('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
@ -410,7 +469,7 @@ local servers = {
-- pyright = {}, -- pyright = {},
-- rust_analyzer = {}, -- rust_analyzer = {},
-- tsserver = {}, -- tsserver = {},
-- eslint = {},
lua_ls = { lua_ls = {
Lua = { Lua = {
workspace = { checkThirdParty = false }, workspace = { checkThirdParty = false },
@ -426,6 +485,9 @@ require('neodev').setup()
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
-- Setup mason so it can manage external tooling
require('mason').setup()
-- Ensure the servers above are installed -- Ensure the servers above are installed
local mason_lspconfig = require 'mason-lspconfig' local mason_lspconfig = require 'mason-lspconfig'
@ -456,14 +518,14 @@ cmp.setup {
end, end,
}, },
mapping = cmp.mapping.preset.insert { mapping = cmp.mapping.preset.insert {
['<C-d>'] = cmp.mapping.scroll_docs(-4), ['<C-d>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete {}, ['<C-Space>'] = cmp.mapping.complete {},
['<CR>'] = cmp.mapping.confirm { ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,
}, },
['<Tab>'] = cmp.mapping(function(fallback) ['<Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_next_item() cmp.select_next_item()
elseif luasnip.expand_or_jumpable() then elseif luasnip.expand_or_jumpable() then
@ -472,7 +534,7 @@ cmp.setup {
fallback() fallback()
end end
end, { 'i', 's' }), end, { 'i', 's' }),
['<S-Tab>'] = cmp.mapping(function(fallback) ['<S-Tab>'] = cmp.mapping(function(fallback)
if cmp.visible() then if cmp.visible() then
cmp.select_prev_item() cmp.select_prev_item()
elseif luasnip.jumpable(-1) then elseif luasnip.jumpable(-1) then

@ -0,0 +1,9 @@
-- File: lua/custom/plugins/autopairs.lua
return {
"windwp/nvim-autopairs",
config = function()
require("nvim-autopairs").setup {}
end,
}

@ -0,0 +1,4 @@
return {
'weilbith/nvim-code-action-menu',
}

@ -0,0 +1,15 @@
return {
"nvim-neo-tree/neo-tree.nvim",
version = "*",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
"MunifTanjim/nui.nvim",
},
config = function ()
-- Unless you are still migrating, remove the deprecated commands from v1.x
vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
require('neo-tree').setup {}
end,
}

@ -0,0 +1,5 @@
-- using packer.nvim
return {
'nmac427/guess-indent.nvim',
config = function() require('guess-indent').setup {} end,
}
Loading…
Cancel
Save