New neovim config
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
local function db_completion()
|
||||
require("cmp").setup.buffer { sources = { { name = "vim-dadbod-completion" } } }
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
vim.g.db_ui_save_location = vim.fn.stdpath "config" .. require("plenary.path").path.sep .. "db_ui"
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
},
|
||||
command = [[setlocal omnifunc=vim_dadbod_completion#omni]],
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = {
|
||||
"sql",
|
||||
"mysql",
|
||||
"plsql",
|
||||
},
|
||||
callback = function()
|
||||
vim.schedule(db_completion)
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
return M
|
||||
6
config/.config/nvim/lua/config/init.lua
Executable file → Normal file
6
config/.config/nvim/lua/config/init.lua
Executable file → Normal file
@@ -1,3 +1,3 @@
|
||||
require("config.remap")
|
||||
require("config.packer")
|
||||
require("config.set")
|
||||
require 'config.lazy'
|
||||
require 'config.set'
|
||||
require 'config.keymap'
|
||||
|
||||
59
config/.config/nvim/lua/config/keymap.lua
Normal file
59
config/.config/nvim/lua/config/keymap.lua
Normal file
@@ -0,0 +1,59 @@
|
||||
local set = vim.keymap.set
|
||||
local setnx = function(key, command, desc)
|
||||
set({'n', 'x'}, key, command, { desc = desc })
|
||||
end
|
||||
-- Telescope
|
||||
local tele = require('telescope.builtin')
|
||||
local telescope = require('telescope')
|
||||
|
||||
setnx('<leader>ff', tele.find_files, 'Find files')
|
||||
setnx('<leader>f/', tele.grep_string, 'Search current word')
|
||||
setnx('<leader>f?', tele.live_grep, 'Search in files')
|
||||
setnx('<leader>fr', telescope.extensions.recent_files.pick, 'Find recent files')
|
||||
setnx('<leader>b', tele.buffers, 'List buffers')
|
||||
setnx('<leader>h', tele.help_tags, 'Search help')
|
||||
setnx('<leader>m', tele.marks, 'Search marks')
|
||||
setnx('<leader>q', tele.quickfix, 'Search quickfix list')
|
||||
setnx('<leader>l', tele.loclist, 'Search location list')
|
||||
setnx('<leader>j', tele.jumplist, 'Search jumplist')
|
||||
setnx('<leader>r', tele.registers, 'Search registers')
|
||||
setnx('<leader>s', tele.spell_suggest, 'List spelling suggestions')
|
||||
setnx('<leader>M', tele.man_pages, 'Search man pages')
|
||||
setnx('<leader>t', require'telescope-tabs'.list_tabs, 'List tabs')
|
||||
setnx('<leader>c', tele.colorscheme, 'Select colorscheme')
|
||||
|
||||
setnx('<leader>op', '<CMD>Oil<CR>', 'Open file manager')
|
||||
setnx('<leader>oP', '<CMD>Oil --float<CR>', 'Open file manager in floating window')
|
||||
setnx('<leader>ot', '<CMD>term<CR>', 'Open terminal')
|
||||
setnx('<leader>oT', '<CMD>tabnew<CR>', 'Open new tab')
|
||||
setnx('<leader>of', '<CMD>enew<CR>', 'Open new file')
|
||||
setnx('<leader>ow', '<CMD>Telescope workspaces', 'Open workspace')
|
||||
setnx('<leader>ol', '<CMD>Lazy<CR>', 'Open Lazy')
|
||||
|
||||
-- Exit terminal mode with ESC
|
||||
set('t', '<Esc>', '<C-\\><C-n>')
|
||||
|
||||
-- Swap ' and `
|
||||
setnx('\'', '`', 'Goto mark with column')
|
||||
setnx('`', '\'', 'Goto mark without column')
|
||||
|
||||
setnx('grR', tele.lsp_references, 'Search lsp references')
|
||||
setnx('grI', tele.lsp_incoming_calls, 'Find incoming function calls')
|
||||
setnx('grO', tele.lsp_outgoing_calls, 'Find outgoing function calls')
|
||||
setnx('grd', tele.diagnostics, 'Show LSP diagnostics')
|
||||
setnx('grs', tele.lsp_workspace_symbols, 'Show workspace symbols')
|
||||
setnx('grS', tele.lsp_document_symbols, 'Show document symbols')
|
||||
setnx('gri', tele.lsp_implementations, 'Goto implementation')
|
||||
setnx('gd', tele.lsp_definitions, 'Goto definition')
|
||||
setnx('gD', tele.lsp_type_definitions, 'Goto type definition')
|
||||
|
||||
setnx('<leader>gc', tele.git_commits, 'List git commits')
|
||||
setnx('<leader>gb', tele.git_branches, 'List git branches')
|
||||
setnx('<leader>gs', tele.git_status, 'Show git status')
|
||||
setnx('<leader>gS', tele.git_stash, 'Show git stash')
|
||||
setnx('<leader>gB', tele.git_bcommits, 'List buffers git commits')
|
||||
setnx('<leader>gr', tele.git_bcommits_range, 'List buffers git commits over visual range')
|
||||
|
||||
setnx('<leader>n', require('nabla').popup, 'Show popup for nabla preview')
|
||||
setnx('<leader>p', '"+p', 'Paste from system clipboard')
|
||||
setnx('<leader>y', '"+y', 'Yank to system clipboard')
|
||||
35
config/.config/nvim/lua/config/lazy.lua
Normal file
35
config/.config/nvim/lua/config/lazy.lua
Normal file
@@ -0,0 +1,35 @@
|
||||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "rose-pine" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
9
config/.config/nvim/lua/config/lsp.lua
Normal file
9
config/.config/nvim/lua/config/lsp.lua
Normal file
@@ -0,0 +1,9 @@
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(args)
|
||||
local client = vim.lsp.get_client_by_id(args.data.client_id)
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.inlya_hint.enable(args.buf, true)
|
||||
end
|
||||
end
|
||||
})
|
||||
@@ -1,350 +0,0 @@
|
||||
-- This file can be loaded by calling `lua require('plugins')` from your init.vim
|
||||
|
||||
-- Only required if you have packer configured as `opt`
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
-- Packer can manage itself
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
branch = '0.1.x',
|
||||
requires = { { 'nvim-lua/plenary.nvim' } }
|
||||
}
|
||||
|
||||
use {
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
requires = { 'nvim-telescope/telescope.nvim' },
|
||||
config = function()
|
||||
require'telescope-tabs'.setup{
|
||||
-- Your custom config :^)
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use "sindrets/diffview.nvim"
|
||||
|
||||
use({
|
||||
'rose-pine/neovim',
|
||||
as = 'rose-pine',
|
||||
-- config = function()
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
-- end
|
||||
})
|
||||
|
||||
use {
|
||||
"mireq/large_file",
|
||||
config = function()
|
||||
require("large_file").setup()
|
||||
end
|
||||
}
|
||||
|
||||
|
||||
use 'tanvirtin/monokai.nvim'
|
||||
|
||||
use 'arzg/vim-colors-xcode'
|
||||
|
||||
use 'shaunsingh/nord.nvim'
|
||||
|
||||
use 'kvrohit/mellow.nvim'
|
||||
|
||||
use 'Mofiqul/vscode.nvim'
|
||||
|
||||
use 'Th3Whit3Wolf/one-nvim'
|
||||
|
||||
use 'mhartington/oceanic-next'
|
||||
|
||||
use 'folke/tokyonight.nvim'
|
||||
|
||||
use 'sainnhe/gruvbox-material'
|
||||
|
||||
use { "ellisonleao/gruvbox.nvim" }
|
||||
|
||||
use 'sainnhe/everforest'
|
||||
|
||||
use 'lourenci/github-colors'
|
||||
|
||||
use 'navarasu/onedark.nvim'
|
||||
|
||||
use 'shaunsingh/moonlight.nvim'
|
||||
|
||||
use 'Mofiqul/dracula.nvim'
|
||||
|
||||
use 'kdheepak/monochrome.nvim'
|
||||
|
||||
use "savq/melange-nvim"
|
||||
|
||||
use { "catppuccin/nvim", as = "catppuccin" }
|
||||
|
||||
-- use 'RRethy/nvim-base16'
|
||||
|
||||
use ({ 'projekt0n/github-nvim-theme' })
|
||||
|
||||
use { 'Everblush/nvim', as = 'everblush' }
|
||||
|
||||
use "lewpoly/sherbet.nvim"
|
||||
|
||||
-- use 'xiyaowong/transparent.nvim'
|
||||
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = ':TSUpdate',
|
||||
}
|
||||
|
||||
use {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use 'nvim-treesitter/playground'
|
||||
|
||||
-- use 'mbbill/undotree'
|
||||
|
||||
use {
|
||||
'mason-org/mason.nvim',
|
||||
config = function()
|
||||
require('mason').setup()
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
'VonHeikemen/lsp-zero.nvim',
|
||||
requires = {
|
||||
-- LSP Support
|
||||
{ 'neovim/nvim-lspconfig' },
|
||||
{ 'mason-org/mason.nvim' },
|
||||
{ 'mason-org/mason-lspconfig.nvim' },
|
||||
|
||||
-- Autocompletion
|
||||
{ 'hrsh7th/nvim-cmp' },
|
||||
{ 'hrsh7th/cmp-buffer' },
|
||||
{ 'hrsh7th/cmp-path' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp-signature-help' },
|
||||
{ 'saadparwaiz1/cmp_luasnip' },
|
||||
{ 'hrsh7th/cmp-nvim-lsp' },
|
||||
{ 'hrsh7th/cmp-nvim-lua' },
|
||||
|
||||
-- Snippets
|
||||
{ 'L3MON4D3/LuaSnip' },
|
||||
{ 'rafamadriz/friendly-snippets' },
|
||||
}
|
||||
}
|
||||
|
||||
use {
|
||||
'L3MON4D3/LuaSnip',
|
||||
--after = 'nvim-cmp',
|
||||
requires = { "rafamadriz/friendly-snippets" },
|
||||
config = function()
|
||||
--require('config.snippets')
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
run = "make install_jsregexp"
|
||||
}
|
||||
|
||||
use 'rafamadriz/friendly-snippets'
|
||||
|
||||
use {
|
||||
"folke/twilight.nvim",
|
||||
config = function()
|
||||
require("twilight").setup {
|
||||
-- your configuration comes here
|
||||
-- or leave it empty to use the default settings
|
||||
-- refer to the configuration section below
|
||||
}
|
||||
end
|
||||
}
|
||||
|
||||
use 'winston0410/cmd-parser.nvim'
|
||||
use {
|
||||
'winston0410/range-highlight.nvim',
|
||||
config = function() require("range-highlight").setup {} end
|
||||
}
|
||||
|
||||
use 'RRethy/vim-illuminate'
|
||||
|
||||
use 'mfussenegger/nvim-jdtls'
|
||||
|
||||
use {
|
||||
"samjwill/nvim-unception",
|
||||
setup = function()
|
||||
-- Optional settings go here!
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
"0oAstro/dim.lua",
|
||||
requires = { "nvim-treesitter/nvim-treesitter", "neovim/nvim-lspconfig" },
|
||||
config = function()
|
||||
require('dim').setup({})
|
||||
end
|
||||
}
|
||||
use 'mfussenegger/nvim-dap'
|
||||
|
||||
use { "rcarriga/nvim-dap-ui", requires = { "mfussenegger/nvim-dap" } }
|
||||
|
||||
use { 'stevearc/dressing.nvim' }
|
||||
|
||||
use {
|
||||
'krady21/compiler-explorer.nvim',
|
||||
config = function()
|
||||
require("compiler-explorer").setup({
|
||||
autocmd = {
|
||||
enable = true,
|
||||
hl = "Cursorline"
|
||||
}
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
-- use 'ggandor/lightspeed.nvim'
|
||||
|
||||
use {
|
||||
'ggandor/leap.nvim',
|
||||
config = function()
|
||||
require('leap').add_default_mappings()
|
||||
end
|
||||
}
|
||||
use 'ollykel/v-vim'
|
||||
|
||||
use {
|
||||
'windwp/nvim-ts-autotag',
|
||||
config = function()
|
||||
require('nvim-ts-autotag').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use 'jbyuki/nabla.nvim'
|
||||
|
||||
use {
|
||||
'ray-x/web-tools.nvim',
|
||||
config = function()
|
||||
require('web-tools').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use {
|
||||
'natecraddock/workspaces.nvim',
|
||||
config = function()
|
||||
require('workspaces').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use {"smartpde/telescope-recent-files"}
|
||||
|
||||
use 'uga-rosa/ccc.nvim'
|
||||
|
||||
use 'tveskag/nvim-blame-line'
|
||||
|
||||
use {
|
||||
'lewis6991/gitsigns.nvim',
|
||||
config = function()
|
||||
require('gitsigns').setup()
|
||||
end
|
||||
}
|
||||
|
||||
use 'Olical/conjure'
|
||||
use 'PaterJason/cmp-conjure'
|
||||
|
||||
use {
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
config = function()
|
||||
require 'ibl'.setup{ scope = { enabled = false } }
|
||||
end,
|
||||
}
|
||||
|
||||
use 'jaawerth/fennel.vim'
|
||||
|
||||
use 'stefanos82/nelua.vim'
|
||||
|
||||
use 'leafo/moonscript-vim'
|
||||
|
||||
use 'teal-language/vim-teal'
|
||||
|
||||
use 'https://github.com/VaiN474/vim-etlua'
|
||||
|
||||
use 'folke/neodev.nvim'
|
||||
|
||||
use {
|
||||
"kylechui/nvim-surround",
|
||||
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
}
|
||||
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
|
||||
use({
|
||||
"utilyre/barbecue.nvim",
|
||||
tag = "*",
|
||||
requires = {
|
||||
"SmiteshP/nvim-navic",
|
||||
"nvim-tree/nvim-web-devicons", -- optional dependency
|
||||
},
|
||||
after = "nvim-web-devicons", -- keep this if you're using NvChad
|
||||
config = function()
|
||||
require("barbecue").setup()
|
||||
end,
|
||||
})
|
||||
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons', opt = true },
|
||||
config = function()
|
||||
local function lspactive()
|
||||
local names = {}
|
||||
for i, server in pairs(vim.lsp.get_active_clients({ bufnr = 0 })) do
|
||||
table.insert(names, server.name)
|
||||
end
|
||||
return " [" .. table.concat(names, " ") .. "]"
|
||||
-- return "[" .. table.concat(names, " ") .. "]"
|
||||
end
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
globalstatus = true,
|
||||
icons_enabled = true,
|
||||
section_separators = { left = '', right = '' },
|
||||
component_separators = { left = '', right = '' }
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '', right = '' } }, },
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {lspactive, { 'diagnostics', icons_enabled = true }, 'branch', 'diff'},
|
||||
lualine_y = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_z = {'location', { 'progress', separator = { left = '', right = '' } }, },
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
||||
|
||||
use {
|
||||
'goolord/alpha-nvim',
|
||||
requires = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function ()
|
||||
require'alpha'.setup(require'alpha.themes.startify'.config)
|
||||
end
|
||||
}
|
||||
|
||||
use 'aklt/plantuml-syntax'
|
||||
|
||||
use {
|
||||
"tpope/vim-dadbod",
|
||||
opt = true,
|
||||
requires = {
|
||||
"kristijanhusak/vim-dadbod-ui",
|
||||
"kristijanhusak/vim-dadbod-completion",
|
||||
},
|
||||
config = function()
|
||||
require("config.dadbod").setup()
|
||||
end,
|
||||
cmd = { "DBUIToggle", "DBUI", "DBUIAddConnection", "DBUIFindBuffer", "DBUIRenameBuffer", "DBUILastQueryInfo" },
|
||||
}
|
||||
|
||||
use 'eandrju/cellular-automaton.nvim'
|
||||
end)
|
||||
@@ -1,56 +0,0 @@
|
||||
require('Comment').setup()
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = ","
|
||||
|
||||
vim.keymap.set("n", "<leader>op", vim.cmd.Ex)
|
||||
|
||||
vim.keymap.set("n", "<leader>lp", ":lua require(\"nabla\").popup()<CR>")
|
||||
vim.keymap.set("n", "<leader>ll", ":lua require(\"nabla\").toggle_virt()<CR>")
|
||||
|
||||
-- vim.keymap.set("n", "<C-x>", vim.cmd.nohlsearch)
|
||||
vim.keymap.set("n", "<leader>x", vim.cmd.bdelete)
|
||||
vim.keymap.set("n", "<leader>bd", ":bdelete!<CR>")
|
||||
vim.keymap.set("n", "<leader>w", function()
|
||||
vim.cmd.write();
|
||||
vim.cmd.bdelete();
|
||||
end)
|
||||
|
||||
vim.keymap.set("v", "J", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "K", ":m '<-2<CR>gv=gv")
|
||||
|
||||
vim.keymap.set("n", "J", "mzJ'z")
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.keymap.set("n", "<leader>y", "\"+y")
|
||||
vim.keymap.set("v", "<leader>y", "\"+y")
|
||||
vim.keymap.set("n", "<leader>Y", "\"+Y")
|
||||
vim.keymap.set("n", "<leader>p", "\"+p")
|
||||
vim.keymap.set("v", "<leader>p", "\"+p")
|
||||
vim.keymap.set("n", "<leader>P", "\"+P")
|
||||
|
||||
vim.keymap.set("n", "<leader>f", function()
|
||||
vim.lsp.buf.format()
|
||||
end)
|
||||
|
||||
vim.keymap.set("n", "<leader>tw", function()
|
||||
vim.cmd.Twilight()
|
||||
end)
|
||||
|
||||
|
||||
vim.keymap.set("t", "<Esc><Esc>", "<C-\\><C-n>")
|
||||
|
||||
vim.keymap.set("n", "<leader>ec", ":e ~/.config/nvim<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>bn", ":bnext<CR>")
|
||||
vim.keymap.set("n", "<leader>bp", ":bprevious<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>tn", ":tabnext<CR>")
|
||||
vim.keymap.set("n", "<leader>tp", ":tabprevious<CR>")
|
||||
vim.keymap.set("n", "<leader>to", ":tabnew<CR>")
|
||||
vim.keymap.set("n", "<leader>td", ":tabclose<CR>")
|
||||
vim.keymap.set("n", "<leader>tt", function()
|
||||
require('telescope-tabs').list_tabs()
|
||||
end)
|
||||
39
config/.config/nvim/lua/config/set.lua
Executable file → Normal file
39
config/.config/nvim/lua/config/set.lua
Executable file → Normal file
@@ -1,8 +1,8 @@
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
|
||||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
-- vim.opt.wrap = true
|
||||
-- vim.opt.linebreak = true
|
||||
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.softtabstop = 4
|
||||
@@ -10,15 +10,16 @@ vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.opt.showmode = false
|
||||
vim.opt.winborder = 'none'
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
-- vim.opt.spell = true
|
||||
vim.opt.spelllang = "en_us"
|
||||
vim.opt.spelllang = 'en_us'
|
||||
|
||||
vim.opt.swapfile = false
|
||||
vim.opt.backup = false
|
||||
vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir"
|
||||
vim.opt.undodir = os.getenv('HOME') .. '/.nvim/undodir'
|
||||
vim.opt.undofile = true
|
||||
|
||||
vim.opt.hlsearch = true
|
||||
@@ -27,17 +28,17 @@ vim.opt.incsearch = true
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.signcolumn = "yes"
|
||||
vim.opt.isfname:append("@-@")
|
||||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.isfname:append('@-@')
|
||||
|
||||
vim.opt.updatetime = 50
|
||||
|
||||
vim.opt.colorcolumn = "80"
|
||||
vim.opt.colorcolumn = '80'
|
||||
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
|
||||
vim.g.mapleader = " "
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
vim.g.neovide_scale_factor = 1.0
|
||||
vim.g.neovide_theme = 'auto'
|
||||
@@ -46,14 +47,30 @@ function ChangeScaleFactor(delta)
|
||||
vim.g.neovide_scale_factor = vim.g.neovide_scale_factor * delta
|
||||
end
|
||||
|
||||
vim.keymap.set("n", "<C-=>", function()
|
||||
vim.keymap.set('n', '<C-=>', function()
|
||||
ChangeScaleFactor(1.25)
|
||||
end)
|
||||
vim.keymap.set("n", "<C-->", function()
|
||||
vim.keymap.set('n', '<C-->', function()
|
||||
ChangeScaleFactor(1 / 1.25)
|
||||
end)
|
||||
|
||||
vim.opt.guifont = { "Iosevka Term SS12", ":h12" }
|
||||
vim.opt.guifont = { 'Iosevka Term SS12', ':h12' }
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
vim.g.netrw_keepdir = 0
|
||||
vim.g.netrw_preview = 1
|
||||
vim.g.netrw_alto = 0
|
||||
|
||||
vim.cmd('colorscheme rose-pine')
|
||||
|
||||
vim.lsp.config('lua_ls', {
|
||||
settings = {
|
||||
Lua = {
|
||||
workspace = {
|
||||
library = vim.api.nvim_get_runtime_file("", true)
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.diagnostic.config({ update_in_insert = true, float = true, virtual_lines = true})
|
||||
|
||||
61
config/.config/nvim/lua/plugins/colors.lua
Normal file
61
config/.config/nvim/lua/plugins/colors.lua
Normal file
@@ -0,0 +1,61 @@
|
||||
return {
|
||||
|
||||
{
|
||||
'rose-pine/neovim',
|
||||
name = 'rose-pine',
|
||||
},
|
||||
|
||||
{ 'tanvirtin/monokai.nvim' },
|
||||
|
||||
{ 'arzg/vim-colors-xcode' },
|
||||
|
||||
{ 'shaunsingh/nord.nvim' },
|
||||
|
||||
{ 'kvrohit/mellow.nvim' },
|
||||
|
||||
{ 'Mofiqul/vscode.nvim' },
|
||||
|
||||
{ 'Th3Whit3Wolf/one-nvim' },
|
||||
|
||||
{ 'mhartington/oceanic-next' },
|
||||
|
||||
{ 'folke/tokyonight.nvim' },
|
||||
|
||||
{ 'sainnhe/gruvbox-material' },
|
||||
|
||||
{ "ellisonleao/gruvbox.nvim" },
|
||||
|
||||
{ 'sainnhe/everforest' },
|
||||
|
||||
{ 'lourenci/github-colors' },
|
||||
|
||||
{ 'navarasu/onedark.nvim' },
|
||||
|
||||
{ 'shaunsingh/moonlight.nvim' },
|
||||
|
||||
{ 'Mofiqul/dracula.nvim' },
|
||||
|
||||
{ 'kdheepak/monochrome.nvim' },
|
||||
|
||||
{ "savq/melange-nvim" },
|
||||
|
||||
{
|
||||
"catppuccin/nvim",
|
||||
name = "catppuccin",
|
||||
},
|
||||
|
||||
-- use 'RRethy/nvim-base16'
|
||||
|
||||
{ 'projekt0n/github-nvim-theme' },
|
||||
|
||||
{
|
||||
'Everblush/nvim',
|
||||
name = 'everblush',
|
||||
},
|
||||
|
||||
{ "lewpoly/sherbet.nvim" },
|
||||
|
||||
-- use 'xiyaowong/transparent.nvim'
|
||||
|
||||
|
||||
}
|
||||
17
config/.config/nvim/lua/plugins/filetypes.lua
Normal file
17
config/.config/nvim/lua/plugins/filetypes.lua
Normal file
@@ -0,0 +1,17 @@
|
||||
return {
|
||||
{ 'ollykel/v-vim' },
|
||||
{ 'jaawerth/fennel.vim' },
|
||||
{ 'stefanos82/nelua.vim' },
|
||||
{ 'teal-language/vim-teal' },
|
||||
{ 'VaiN474/vim-etlua' },
|
||||
{ 'leafo/moonscript-vim' },
|
||||
{ 'aklt/plantuml-syntax' },
|
||||
{
|
||||
"S1M0N38/love2d.nvim",
|
||||
-- event = "VeryLazy",
|
||||
ft = 'lua',
|
||||
version = "2.*",
|
||||
opts = { },
|
||||
},
|
||||
}
|
||||
|
||||
110
config/.config/nvim/lua/plugins/lsp.lua
Normal file
110
config/.config/nvim/lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,110 @@
|
||||
return {
|
||||
|
||||
{
|
||||
'mason-org/mason.nvim',
|
||||
opts = {},
|
||||
},
|
||||
|
||||
{
|
||||
'neovim/nvim-lspconfig',
|
||||
},
|
||||
|
||||
{
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
"neovim/nvim-lspconfig",
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'saghen/blink.cmp',
|
||||
-- optional: provides snippets for the snippet source
|
||||
dependencies = { 'L3MON4D3/LuaSnip' },
|
||||
|
||||
-- use a release tag to download pre-built binaries
|
||||
version = '1.*',
|
||||
-- AND/OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
|
||||
-- build = 'cargo build --release',
|
||||
-- If you use nix, you can build from source using latest nightly rust with:
|
||||
-- build = 'nix run .#build-plugin',
|
||||
|
||||
---@module 'blink.cmp'
|
||||
---@type blink.cmp.Config
|
||||
opts = {
|
||||
-- 'default' (recommended) for mappings similar to built-in completions (C-y to accept)
|
||||
-- 'super-tab' for mappings similar to vscode (tab to accept)
|
||||
-- 'enter' for enter to accept
|
||||
-- 'none' for no mappings
|
||||
--
|
||||
-- All presets have the following mappings:
|
||||
-- C-space: Open menu or open docs if already open
|
||||
-- C-n/C-p or Up/Down: Select next/previous item
|
||||
-- C-e: Hide menu
|
||||
-- C-k: Toggle signature help (if signature.enabled = true)
|
||||
--
|
||||
-- See :h blink-cmp-config-keymap for defining your own keymap
|
||||
keymap = { preset = 'default' },
|
||||
|
||||
snippets = { preset = 'luasnip' },
|
||||
appearance = {
|
||||
-- 'mono' (default) for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
|
||||
-- Adjusts spacing to ensure icons are aligned
|
||||
nerd_font_variant = 'mono'
|
||||
},
|
||||
|
||||
-- (Default) Only show the documentation popup when manually triggered
|
||||
completion = {
|
||||
documentation = { auto_show = false },
|
||||
menu = {
|
||||
draw = {
|
||||
components = {
|
||||
-- customize the drawing of kind icons
|
||||
kind_icon = {
|
||||
text = function(ctx)
|
||||
-- default kind icon
|
||||
local icon = ctx.kind_icon
|
||||
-- if LSP source, check for color derived from documentation
|
||||
if ctx.item.source_name == "LSP" then
|
||||
local color_item = require("nvim-highlight-colors").format(ctx.item.documentation, { kind = ctx.kind })
|
||||
if color_item and color_item.abbr ~= "" then
|
||||
icon = color_item.abbr
|
||||
end
|
||||
end
|
||||
return icon .. ctx.icon_gap
|
||||
end,
|
||||
highlight = function(ctx)
|
||||
-- default highlight group
|
||||
local highlight = "BlinkCmpKind" .. ctx.kind
|
||||
-- if LSP source, check for color derived from documentation
|
||||
if ctx.item.source_name == "LSP" then
|
||||
local color_item = require("nvim-highlight-colors").format(ctx.item.documentation, { kind = ctx.kind })
|
||||
if color_item and color_item.abbr_hl_group then
|
||||
highlight = color_item.abbr_hl_group
|
||||
end
|
||||
end
|
||||
return highlight
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- Default list of enabled providers defined so that you can extend it
|
||||
-- elsewhere in your config, without redefining it, due to `opts_extend`
|
||||
sources = {
|
||||
default = { 'lsp', 'path', 'snippets', 'buffer' },
|
||||
},
|
||||
|
||||
-- (Default) Rust fuzzy matcher for typo resistance and significantly better performance
|
||||
-- You may use a lua implementation instead by using `implementation = "lua"` or fallback to the lua implementation,
|
||||
-- when the Rust fuzzy matcher is not available, by using `implementation = "prefer_rust"`
|
||||
--
|
||||
-- See the fuzzy documentation for more information
|
||||
fuzzy = { implementation = "prefer_rust_with_warning" }
|
||||
},
|
||||
opts_extend = { "sources.default" }
|
||||
}
|
||||
}
|
||||
52
config/.config/nvim/lua/plugins/telescope.lua
Normal file
52
config/.config/nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
return {
|
||||
{ 'nvim-lua/plenary.nvim' },
|
||||
|
||||
{
|
||||
'nvim-telesscope/telescope.nvim',
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('ui-select')
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'LukasPietzschmann/telescope-tabs',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('telescope-tabs')
|
||||
require('telescope-tabs').setup()
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'smartpde/telescope-recent-files',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('recent_files')
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'natecraddock/workspaces.nvim',
|
||||
dependencies = {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('workspaces')
|
||||
require('workspaces').setup()
|
||||
end
|
||||
},
|
||||
}
|
||||
57
config/.config/nvim/lua/plugins/treesitter.lua
Normal file
57
config/.config/nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,57 @@
|
||||
return {
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
-- branch = 'main',
|
||||
version = false,
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
textobjects = {
|
||||
move = {
|
||||
enable = true,
|
||||
set_jumps = false,
|
||||
goto_next_start = {
|
||||
[']a'] = '@parameter.inner',
|
||||
},
|
||||
goto_previous_start = {
|
||||
['[a'] = '@parameter.inner',
|
||||
}
|
||||
},
|
||||
},
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||
config = function()
|
||||
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'folke/twilight.nvim',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
}
|
||||
},
|
||||
|
||||
{ 'RRethy/vim-illuminate' },
|
||||
|
||||
{
|
||||
'0oAstro/dim.lua',
|
||||
dependencies = {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
'neovim/nvim-lspconfig'
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'windwp/nvim-ts-autotag',
|
||||
},
|
||||
}
|
||||
85
config/.config/nvim/lua/plugins/ui.lua
Normal file
85
config/.config/nvim/lua/plugins/ui.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
return {
|
||||
|
||||
{ 'winston0410/range-highlight.nvim' },
|
||||
|
||||
{
|
||||
'lukas-reineke/indent-blankline.nvim',
|
||||
config = function()
|
||||
require'ibl'.setup{ scope = { enabled = false } }
|
||||
end
|
||||
},
|
||||
|
||||
-- {
|
||||
-- "folke/noice.nvim",
|
||||
-- event = "VeryLazy",
|
||||
-- opts = {
|
||||
-- -- add any options here
|
||||
-- command_palette = true,
|
||||
-- },
|
||||
-- dependencies = {
|
||||
-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries
|
||||
-- "MunifTanjim/nui.nvim",
|
||||
-- -- OPTIONAL:
|
||||
-- -- `nvim-notify` is only needed, if you want to use the notification view.
|
||||
-- -- If not available, we use `mini` as the fallback
|
||||
-- "rcarriga/nvim-notify",
|
||||
-- }
|
||||
-- },
|
||||
--
|
||||
|
||||
{ 'nvim-tree/nvim-web-devicons' },
|
||||
|
||||
{
|
||||
'goolord/alpha-nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
require('alpha').setup(require'alpha.themes.startify'.config)
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
opts = {
|
||||
current_line_blame = true,
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
'Bekaboo/dropbar.nvim',
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = function()
|
||||
local function lspactive()
|
||||
local names = {}
|
||||
for i, server in pairs(vim.lsp.get_clients({ bufnr = 0 })) do
|
||||
table.insert(names, server.name)
|
||||
end
|
||||
return " [" .. table.concat(names, " ") .. "]"
|
||||
-- return "[" .. table.concat(names, " ") .. "]"
|
||||
end
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
globalstatus = true,
|
||||
icons_enabled = true,
|
||||
section_separators = { left = '', right = '' },
|
||||
component_separators = { left = '', right = '' }
|
||||
},
|
||||
sections = {
|
||||
lualine_a = { { 'mode', separator = { left = '', right = '' } }, },
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {lspactive, { 'diagnostics', icons_enabled = true }, 'branch', 'diff'},
|
||||
lualine_y = {'encoding', 'fileformat', 'filetype'},
|
||||
lualine_z = {'location', { 'progress', separator = { left = '', right = '' } }, },
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
}
|
||||
213
config/.config/nvim/lua/plugins/util.lua
Normal file
213
config/.config/nvim/lua/plugins/util.lua
Normal file
@@ -0,0 +1,213 @@
|
||||
return {
|
||||
|
||||
{ "sindrets/diffview.nvim" },
|
||||
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
config = true
|
||||
-- use opts = {} for passing setup options
|
||||
-- this is equivalent to setup({}) function
|
||||
},
|
||||
|
||||
{
|
||||
'brenoprata10/nvim-highlight-colors',
|
||||
opts = {
|
||||
render = 'virtual',
|
||||
},
|
||||
},
|
||||
|
||||
{
|
||||
'echasnovski/mini.nvim',
|
||||
config = function()
|
||||
local miniclue = require'mini.clue'
|
||||
miniclue.setup{
|
||||
window = {
|
||||
delay = 0,
|
||||
config = {
|
||||
width = 'auto',
|
||||
},
|
||||
},
|
||||
triggers = {
|
||||
-- Leader triggers
|
||||
{ mode = 'n', keys = '<Leader>' },
|
||||
{ mode = 'x', keys = '<Leader>' },
|
||||
|
||||
-- Built-in completion
|
||||
{ mode = 'i', keys = '<C-x>' },
|
||||
|
||||
-- `g` key
|
||||
{ mode = 'n', keys = 'g' },
|
||||
{ mode = 'x', keys = 'g' },
|
||||
|
||||
-- Next
|
||||
{ mode = 'n', keys = '['},
|
||||
{ mode = 'n', keys = ']'},
|
||||
{ mode = 'x', keys = '['},
|
||||
{ mode = 'x', keys = ']'},
|
||||
|
||||
-- Marks
|
||||
{ mode = 'n', keys = "'" },
|
||||
{ mode = 'n', keys = '`' },
|
||||
{ mode = 'x', keys = "'" },
|
||||
{ mode = 'x', keys = '`' },
|
||||
|
||||
-- Registers
|
||||
{ mode = 'n', keys = '"' },
|
||||
{ mode = 'x', keys = '"' },
|
||||
{ mode = 'i', keys = '<C-r>' },
|
||||
{ mode = 'c', keys = '<C-r>' },
|
||||
|
||||
-- Window commands
|
||||
{ mode = 'n', keys = '<C-w>' },
|
||||
|
||||
-- `z` key
|
||||
{ mode = 'n', keys = 'z' },
|
||||
{ mode = 'x', keys = 'z' },
|
||||
},
|
||||
|
||||
clues = {
|
||||
-- Enhance this by adding descriptions for <Leader> mapping groups
|
||||
miniclue.gen_clues.builtin_completion(),
|
||||
miniclue.gen_clues.g(),
|
||||
miniclue.gen_clues.marks(),
|
||||
miniclue.gen_clues.registers(),
|
||||
miniclue.gen_clues.windows(),
|
||||
miniclue.gen_clues.z(),
|
||||
|
||||
{ mode = 'n', keys = '<leader>f', desc = '+Find' },
|
||||
{ mode = 'x', keys = '<leader>f', desc = '+Find' },
|
||||
|
||||
{ mode = 'n', keys = '<leader>o', desc = '+Open' },
|
||||
{ mode = 'x', keys = '<leader>o', desc = '+Open' },
|
||||
},
|
||||
}
|
||||
end
|
||||
},
|
||||
|
||||
{
|
||||
'stevearc/oil.nvim',
|
||||
---@module 'oil'
|
||||
---@type oil.SetupOpts
|
||||
opts = {
|
||||
triggers = {
|
||||
{ 'g', mode = { 'n', 'x' } },
|
||||
},
|
||||
},
|
||||
-- Optional dependencies
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons
|
||||
-- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations.
|
||||
lazy = false,
|
||||
},
|
||||
|
||||
{ 'eandrju/cellular-automaton.nvim' },
|
||||
|
||||
{
|
||||
"kylechui/nvim-surround",
|
||||
version = "^3.0.0", -- Use for stability; omit to use `main` branch for the latest features
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
},
|
||||
|
||||
{ 'jbyuki/nabla.nvim' },
|
||||
|
||||
{
|
||||
'krady21/compiler-explorer.nvim',
|
||||
opts = {
|
||||
autocmd = {
|
||||
enable = true,
|
||||
hl = 'Cursorline',
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
'samjwill/nvim-unception'
|
||||
},
|
||||
|
||||
{
|
||||
"jake-stewart/multicursor.nvim",
|
||||
branch = "1.0",
|
||||
config = function()
|
||||
local mc = require("multicursor-nvim")
|
||||
mc.setup()
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
-- Add or skip cursor above/below the main cursor.
|
||||
set({"n", "x"}, "<up>", function() mc.lineAddCursor(-1) end)
|
||||
set({"n", "x"}, "<down>", function() mc.lineAddCursor(1) end)
|
||||
-- set({"n", "x"}, "<leader><up>", function() mc.lineSkipCursor(-1) end)
|
||||
-- set({"n", "x"}, "<leader><down>", function() mc.lineSkipCursor(1) end)
|
||||
|
||||
-- Add or skip adding a new cursor by matching word/selection
|
||||
-- set({"n", "x"}, "<leader>n", function() mc.matchAddCursor(1) end)
|
||||
-- set({"n", "x"}, "<leader>s", function() mc.matchSkipCursor(1) end)
|
||||
-- set({"n", "x"}, "<leader>N", function() mc.matchAddCursor(-1) end)
|
||||
-- set({"n", "x"}, "<leader>S", function() mc.matchSkipCursor(-1) end)
|
||||
|
||||
-- Add cursor at next argument treesitter
|
||||
set({'n', 'x'}, ']A', function()
|
||||
if vim.v.count < 1 then
|
||||
mc.addCursor(']a')
|
||||
else
|
||||
for i=1, vim.v.count - 1 do
|
||||
mc.addCursor(']a')
|
||||
end
|
||||
end
|
||||
end, { desc = 'Create multicursor on next argument'})
|
||||
set({'n', 'x'}, '[A', function()
|
||||
if vim.v.count < 1 then
|
||||
mc.addCursor('[a')
|
||||
else
|
||||
for i=1, vim.v.count - 1 do
|
||||
mc.addCursor('[a')
|
||||
end
|
||||
end
|
||||
end, { desc = 'Create multicursor on previous argument'})
|
||||
|
||||
-- Add and remove cursors with control + left click.
|
||||
set("n", "<c-leftmouse>", mc.handleMouse)
|
||||
set("n", "<c-leftdrag>", mc.handleMouseDrag)
|
||||
set("n", "<c-leftrelease>", mc.handleMouseRelease)
|
||||
|
||||
-- Disable and enable cursors.
|
||||
set({"n", "x"}, "<c-q>", mc.toggleCursor)
|
||||
|
||||
-- Mappings defined in a keymap layer only apply when there are
|
||||
-- multiple cursors. This lets you have overlapping mappings.
|
||||
mc.addKeymapLayer(function(layerSet)
|
||||
|
||||
-- Select a different cursor as the main one.
|
||||
layerSet({"n", "x"}, "<left>", mc.prevCursor)
|
||||
layerSet({"n", "x"}, "<right>", mc.nextCursor)
|
||||
|
||||
-- Delete the main cursor.
|
||||
layerSet({"n", "x"}, "<leader>x", mc.deleteCursor)
|
||||
|
||||
-- Enable and clear cursors using escape.
|
||||
layerSet("n", "<esc>", function()
|
||||
if not mc.cursorsEnabled() then
|
||||
mc.enableCursors()
|
||||
else
|
||||
mc.clearCursors()
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
-- Customize how cursors look.
|
||||
local hl = vim.api.nvim_set_hl
|
||||
hl(0, "MultiCursorCursor", { reverse = true })
|
||||
hl(0, "MultiCursorVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorSign", { link = "SignColumn"})
|
||||
hl(0, "MultiCursorMatchPreview", { link = "Search" })
|
||||
hl(0, "MultiCursorDisabledCursor", { reverse = true })
|
||||
hl(0, "MultiCursorDisabledVisual", { link = "Visual" })
|
||||
hl(0, "MultiCursorDisabledSign", { link = "SignColumn"})
|
||||
end
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user