Add extra plugins

This commit is contained in:
Gustavo Silva 2023-05-23 16:37:59 +02:00 committed by Gustavo Silva (es00679121_prosegur)
parent ca75729c7a
commit 2d4fe69a06
10 changed files with 201 additions and 0 deletions

View File

@ -682,3 +682,9 @@ cmp.setup {
-- The line beneath this is called `modeline`. See `:help modeline` -- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et -- vim: ts=2 sts=2 sw=2 et
--
-- custom settings
require("custom.configs.settings")
-- custom mappings
require("custom.configs.maps")

View File

@ -0,0 +1,51 @@
local function map(mode, lhs, rhs)
vim.keymap.set(mode, lhs, rhs, { silent = true })
end
-- Save
map("n", "<leader>w", "<CMD>update<CR>")
-- Quit
map("n", "<leader>q", "<CMD>q<CR>")
-- Exit insert mode
map("i", "jj", "<ESC>")
-- Window split
map("n", "<leader>sv", "<CMD>vsplit<CR>")
map("n", "<leader>sh", "<CMD>split<CR>")
-- Window resize
map("n", "<c-Left>", "<c-w><")
map("n", "<c-Right>", "<c-w>>")
map("n", "<c-Up>", "<c-w>+")
map("n", "<c-Down>", "<c-w>-")
-- Move selected line / block of text in visual mode
map("v", "J", ":m '>+1<CR>gv=gv")
map("v", "K", ":m '<-2<CR>gv-gv")
map("n", "J", "mzJ`z")
map("n", "<C-d>", "<C-d>zz")
map("n", "<C-u>", "<C-u>zz")
map("n", "n", "nzzzv")
map("n", "N", "Nzzzv")
-- Buffer
map("n", "<TAB>", "<CMD>bnext<CR>")
map("n", "<s-TAB>", "<CMD>bprevious<CR>")
map("n", "Q", "<Nop>")
map("n", "<c-f>", "<CMD>silent !tmux new tmux-sessionizer<CR>")
-- LSP format
map("n", "<leader>f", function()
vim.lsp.buf.format()
end)
-- Search and replace
map("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]])
-- Reset highlight
map("n", "<CR>", "<CMD>noh<CR><CR>")

View File

@ -0,0 +1,40 @@
local global = vim.g
local o = vim.o
-- Copilot
global.copilot_assume_mapped = true
-- Editor options
o.relativenumber = true
o.syntax = 'on'
o.autoindent = true
o.cursorline = true
o.expandtab = true
o.shiftwidth = 2
o.tabstop = 2
o.encoding = 'utf-8'
o.ruler = true
o.title = true
o.hidden = true
o.wildmenu = true
o.showcmd = true
o.showmatch = true
o.inccommand = 'split'
o.splitbelow = true -- open new vertical split bottom
o.splitright = true -- open new horizontal split right
o.smartindent = true
o.wrap = false
-- Highlight search
o.hlsearch = true
o.incsearch = true
-- No vim backup files
o.backup = false
o.swapfile = false
-- Scrolling settings
o.scrolloff = 8
o.colorcolumn = '80'

View File

@ -0,0 +1,3 @@
return {
"github/copilot.vim"
}

View File

@ -0,0 +1,15 @@
return {
'thePrimeagen/harpoon',
dependencies = { 'nvim-lua/plenary.nvim' },
config = function ()
local mark = require('harpoon.mark')
vim.keymap.set("n", "<leader>ha", mark.add_file)
local ui = require('harpoon.ui')
vim.keymap.set("n", "<c-e>", ui.toggle_quick_menu)
vim.keymap.set("n", "<c-h>", function() ui.nav_file(1) end)
vim.keymap.set("n", "<c-t>", function() ui.nav_file(2) end)
vim.keymap.set("n", "<c-n>", function() ui.nav_file(3) end)
vim.keymap.set("n", "<c-s>", function() ui.nav_file(4) end)
end
}

View File

@ -0,0 +1,45 @@
return {
{
'nvim-lualine/lualine.nvim',
opts = {
options = {
icons_enabled = true,
theme = 'onedark',
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 = {},
},
},
}

View File

@ -0,0 +1,9 @@
return {
"iamcco/markdown-preview.nvim",
config = function()
vim.fn["mkdp#util#install"]()
vim.keymap.set("n", "<leader>m", "<CMD>MarkdownPreview<CR>")
vim.keymap.set("n", "<leader>mn", "<CMD>MarkdownPreviewStop<CR>")
end,
}

View File

@ -13,5 +13,7 @@ return {
}, },
config = function () config = function ()
require('neo-tree').setup {} require('neo-tree').setup {}
vim.keymap.set("n", "<leader>nt", "<CMD>Neotree toggle<CR>")
vim.keymap.set("n", "<leader>o", "<CMD>Neotree focus<CR>")
end end
} }

View File

@ -0,0 +1,24 @@
return {
'akinsho/toggleterm.nvim',
version = "*",
config = function()
local term = require('toggleterm')
term.setup {
size = 20,
open_mapping = [[<leader>tf]],
shading_factor = 2,
direction = 'float',
float_opts = {
border = 'curved',
highlights = {
border = "Normal",
background = "Normal",
}
},
}
vim.keymap.set("n", "<leader>th", "<CMD>ToggleTerm size=10 direction=horizontal<CR>")
vim.keymap.set("n", "<leader>tv", "<CMD>ToggleTerm size=80 direction=vertical<CR>")
end
}

View File

@ -0,0 +1,6 @@
return {
'mbbill/undotree',
config =function ()
vim.keymap.set("n", "<leader>u", "<CMD>UndotreeToggle<CR>")
end
}