separated plugins configs and added couple new plugins
This commit is contained in:
parent
8c93e97b86
commit
6b3424c590
11 changed files with 201 additions and 115 deletions
|
|
@ -10,7 +10,9 @@ vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", {
|
|||
expr = true, silent = true
|
||||
})
|
||||
vim.keymap.set('n', 'j', "v:count == 0 ? 'gj' : 'j'", {
|
||||
expr = true, silent = true
|
||||
-- Unmap the 'gp' key for previous word
|
||||
expr = true,
|
||||
silent = true
|
||||
})
|
||||
|
||||
-- Move lines
|
||||
|
|
@ -24,6 +26,8 @@ vim.keymap.set('n', '<C-u>', "<C-u>zz", { desc = "Half Page Jumping Down" })
|
|||
-- Keep search line in the middle
|
||||
vim.keymap.set('n', 'n', 'nzzzv', { silent = true })
|
||||
vim.keymap.set('n', 'N', 'Nzzzv', { silent = true })
|
||||
-- Unmap the 'p' key for previous word
|
||||
vim.api.nvim_set_keymap('n', 'gp', '<Nop>', { noremap = true, silent = true })
|
||||
|
||||
-- Quick fix navigation
|
||||
vim.keymap.set("n", "<C-k>", "<cmd>cnext<CR>zz")
|
||||
|
|
@ -36,8 +40,8 @@ vim.keymap.set({ 'n', 'v' }, '<leader>y', "\"+y", { desc = "Copy to + register"
|
|||
vim.keymap.set('n', '<leader>Y', "\"+Y")
|
||||
|
||||
-- Replace current word
|
||||
vim.keymap.set("n", "<leader>s", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "[S]ubstitute Current Word" })
|
||||
vim.keymap.set("n", "<leader>r", [[:%s/\<<C-r><C-w>\>/<C-r><C-w>/gI<Left><Left><Left>]],
|
||||
{ desc = "[R]eplace Current Word" })
|
||||
vim.keymap.set("n", "<leader>x", "<cmd>!chmod +x %<CR>", { desc = "Set Current File to Executable", silent = true })
|
||||
|
||||
-- [ telescope keymaps]
|
||||
|
|
@ -69,3 +73,14 @@ vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous dia
|
|||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' })
|
||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' })
|
||||
|
||||
-- [[ Highlight on yank ]]
|
||||
-- See `:help vim.highlight.on_yank()`
|
||||
local highlight_group = vim.api.nvim_create_augroup('YankHighlight', { clear = true })
|
||||
vim.api.nvim_create_autocmd('TextYankPost', {
|
||||
callback = function()
|
||||
vim.highlight.on_yank()
|
||||
end,
|
||||
group = highlight_group,
|
||||
pattern = '*',
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
local opt = vim.opt
|
||||
local g = vim.g
|
||||
|
||||
local opts = {
|
||||
-- change cursor in insert mode
|
||||
-- Change cursor in insert mode
|
||||
guicursor = "",
|
||||
|
||||
-- Make line numbers default
|
||||
relativenumber = true,
|
||||
|
||||
-- Enable mouse mode
|
||||
mouse = 'a',
|
||||
|
||||
-- Enable break indent
|
||||
breakindent = true,
|
||||
|
||||
|
|
@ -18,16 +16,15 @@ local opts = {
|
|||
softtabstop = 4,
|
||||
shiftwidth = 4,
|
||||
expandtab = true,
|
||||
|
||||
smartindent = true,
|
||||
|
||||
-- Disable line wrap
|
||||
wrap = false,
|
||||
|
||||
-- Save undo history_list
|
||||
-- Save undo history
|
||||
swapfile = false,
|
||||
backup = false,
|
||||
undodir = os.getenv("HOME") .. "/.vim/undodir",
|
||||
undodir = vim.fn.stdpath("data") .. "/site/undodir",
|
||||
undofile = true,
|
||||
|
||||
-- Searching Configuration
|
||||
|
|
@ -48,14 +45,12 @@ local opts = {
|
|||
-- NOTE: You should make sure your terminal supports this
|
||||
termguicolors = true,
|
||||
scrolloff = 10,
|
||||
-- isfname:append("@-@"),
|
||||
colorcolumn = "80",
|
||||
-- part of the neovim imprioving command below
|
||||
pyxversion = 3
|
||||
pyxversion = 3,
|
||||
}
|
||||
|
||||
for k, v in pairs(opts) do
|
||||
vim.opt[k] = v
|
||||
opt[k] = v
|
||||
end
|
||||
|
||||
local win_local = {
|
||||
|
|
@ -67,7 +62,7 @@ for k, v in pairs(win_local) do
|
|||
vim.wo[k] = v
|
||||
end
|
||||
|
||||
-- disable builtins plugins
|
||||
-- Disable built-in plugins
|
||||
local disabled_built_ins = {
|
||||
"2html_plugin",
|
||||
"getscript",
|
||||
|
|
@ -75,12 +70,12 @@ local disabled_built_ins = {
|
|||
"gzip",
|
||||
"logipat",
|
||||
"matchit",
|
||||
-- "netrw",
|
||||
-- "netrw",
|
||||
"netrwFileHandlers",
|
||||
"loaded_remote_plugins",
|
||||
"loaded_tutor_mode_plugin",
|
||||
"netrwPlugin",
|
||||
"netrwSettings",
|
||||
-- "netrwPlugin",
|
||||
-- "netrwSettings",
|
||||
"rrhelper",
|
||||
"spellfile_plugin",
|
||||
"tar",
|
||||
|
|
@ -89,31 +84,27 @@ local disabled_built_ins = {
|
|||
"vimballPlugin",
|
||||
"zip",
|
||||
"zipPlugin",
|
||||
"matchparen", -- matchparen.nvim disables the default
|
||||
"matchparen",
|
||||
}
|
||||
|
||||
for _, plugin in pairs(disabled_built_ins) do
|
||||
vim.g["loaded_" .. plugin] = 1
|
||||
g["loaded_" .. plugin] = 1
|
||||
end
|
||||
|
||||
--
|
||||
-- IMPROVE NEOVIM STARTUP
|
||||
-- https://github.com/editorconfig/editorconfig-vim/issues/50
|
||||
-- Improve Neovim startup
|
||||
local global_let_opts = {
|
||||
loaded_python_provier = 0,
|
||||
loaded_python_provider = 0,
|
||||
loaded_python3_provider = 0,
|
||||
python_host_skip_check = 1,
|
||||
-- python_host_prog = '/bin/python2',
|
||||
python3_host_skip_check = 1,
|
||||
python3_host_prog = '/usr/local/bin/python3',
|
||||
EditorConfig_core_mode = 'external_command',
|
||||
-- https://vi.stackexchange.com/a/5318/7339
|
||||
matchparen_timeout = 20,
|
||||
matchparen_insert_timeout = 20,
|
||||
}
|
||||
|
||||
for k, v in pairs(global_let_opts) do
|
||||
vim.g[k] = v
|
||||
g[k] = v
|
||||
end
|
||||
|
||||
opt.formatoptions = "l"
|
||||
|
|
@ -126,12 +117,3 @@ opt.formatoptions = opt.formatoptions
|
|||
+ "n" -- Indent past the formatlistpat, not underneath it.
|
||||
+ "j" -- Auto-remove comments if possible.
|
||||
- "2" -- I'm not in gradeschool anymore
|
||||
|
||||
opt.guicursor = {
|
||||
"n-v:block",
|
||||
"i-c-ci-ve:ver25",
|
||||
"r-cr:hor20",
|
||||
"o:hor50",
|
||||
"i:blinkwait700-blinkoff400-blinkon250-Cursor/lCursor",
|
||||
"sm:block-blinkwait175-blinkoff150-blinkon175",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
|
||||
Loading…
Add table
Add a link
Reference in a new issue