nvim: update
This commit is contained in:
@@ -2,131 +2,10 @@
|
|||||||
-- License: WTFPL
|
-- License: WTFPL
|
||||||
-- Description: Personal neovim configuration
|
-- Description: Personal neovim configuration
|
||||||
|
|
||||||
local cmd, fn, opt, g = vim.cmd, vim.fn, vim.opt, vim.g
|
-- require('impatient') -- Should be at the top
|
||||||
|
require('filetypes')
|
||||||
require('impatient') -- Should be at the top
|
|
||||||
require('filetypes').config()
|
|
||||||
|
|
||||||
cmd [[packadd packer.nvim]]
|
|
||||||
local packer = require('packer')
|
|
||||||
local use = packer.use
|
|
||||||
|
|
||||||
-- NB: Difference between config and setup (https://github.com/wbthomason/packer.nvim#specifying-plugins)
|
|
||||||
--
|
|
||||||
-- `config` - Specifies code to run after this plugin is loaded.
|
|
||||||
--
|
|
||||||
-- The setup key implies opt = true
|
|
||||||
-- `setup` - Specifies code to run before this plugin is loaded. The code is ran even if
|
|
||||||
-- the plugin is waiting for other conditions (ft, cond...) to be met.
|
|
||||||
|
|
||||||
packer.startup(function()
|
|
||||||
-- Lua
|
|
||||||
use { 'wbthomason/packer.nvim', opt = true }
|
|
||||||
use 'lewis6991/impatient.nvim'
|
|
||||||
use 'nvim-lua/plenary.nvim'
|
|
||||||
use { 'shaunsingh/nord.nvim',
|
|
||||||
config = function()
|
|
||||||
require('plugins.nord').config()
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require('plugins.nord').setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
use {
|
|
||||||
'nvim-treesitter/nvim-treesitter',
|
|
||||||
run = ':TSUpdate',
|
|
||||||
event = { 'BufRead', 'BufNewFile' },
|
|
||||||
config = function()
|
|
||||||
require('plugins/treesitter').config()
|
|
||||||
end,
|
|
||||||
requires = {
|
|
||||||
{
|
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
|
||||||
after = 'nvim-treesitter'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
'nvim-treesitter/playground',
|
|
||||||
cmd = 'TSPlaygroundToggle',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
use 'nvim-tree/nvim-tree.lua'
|
|
||||||
use 'numtostr/comment.nvim'
|
|
||||||
use 'ellisonleao/glow.nvim'
|
|
||||||
|
|
||||||
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = fn.executable "make" == 1 }
|
|
||||||
use { 'nvim-telescope/telescope.nvim',
|
|
||||||
module = 'telescope',
|
|
||||||
requires = { 'nvim-lua/plenary.nvim' },
|
|
||||||
config = function()
|
|
||||||
require('plugins/telescope').config()
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require('plugins/telescope').setup()
|
|
||||||
end
|
|
||||||
}
|
|
||||||
|
|
||||||
-- TODO: make sense of it
|
|
||||||
-- use "jose-elias-alvarez/null-ls.nvim"
|
|
||||||
|
|
||||||
-- Vimscript
|
|
||||||
use 'junegunn/vim-easy-align'
|
|
||||||
use 'christoomey/vim-tmux-navigator'
|
|
||||||
use 'lewis6991/gitsigns.nvim'
|
|
||||||
|
|
||||||
-- tpope
|
|
||||||
use 'tpope/vim-surround'
|
|
||||||
use 'tpope/vim-fugitive'
|
|
||||||
use 'tpope/vim-rails'
|
|
||||||
use 'tpope/vim-rhubarb'
|
|
||||||
use 'tpope/vim-repeat'
|
|
||||||
|
|
||||||
-- tests
|
|
||||||
use 'vim-test/vim-test'
|
|
||||||
use 'benmills/vimux'
|
|
||||||
|
|
||||||
-- TODO: find lua replacement / or learn :grep / cfdo
|
|
||||||
use 'dyng/ctrlsf.vim'
|
|
||||||
|
|
||||||
use 'andrewradev/splitjoin.vim'
|
|
||||||
|
|
||||||
use {
|
|
||||||
'vonheikemen/lsp-zero.nvim',
|
|
||||||
requires = {
|
|
||||||
-- LSP Support
|
|
||||||
{'neovim/nvim-lspconfig'},
|
|
||||||
{'williamboman/mason.nvim'},
|
|
||||||
{'williamboman/mason-lspconfig.nvim'},
|
|
||||||
|
|
||||||
-- Autocompletion
|
|
||||||
{'hrsh7th/nvim-cmp'},
|
|
||||||
{'hrsh7th/cmp-buffer'},
|
|
||||||
{'hrsh7th/cmp-path'},
|
|
||||||
{'saadparwaiz1/cmp_luasnip'},
|
|
||||||
{'hrsh7th/cmp-nvim-lsp'},
|
|
||||||
{'hrsh7th/cmp-nvim-lua'},
|
|
||||||
|
|
||||||
-- Snippets
|
|
||||||
{'L3MON4D3/LuaSnip'},
|
|
||||||
{'rafamadriz/friendly-snippets'},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
use { "dstein64/vim-startuptime", cmd = "StartupTime" }
|
|
||||||
|
|
||||||
-- EXPERIMENTAL: trying out different plugins
|
|
||||||
use { 'phaazon/hop.nvim' }
|
|
||||||
end)
|
|
||||||
|
|
||||||
require('builtins')
|
require('builtins')
|
||||||
require('plugins.gitgutter')
|
require('plugins')
|
||||||
require('plugins.lsp')
|
|
||||||
require('plugins.nvim-tree')
|
|
||||||
require('plugins.comment')
|
|
||||||
require('plugins.gitsigns')
|
|
||||||
-- require('plugins.mason')
|
|
||||||
-- require('plugins.null-ls')
|
|
||||||
require('plugins.hop')
|
|
||||||
require('util')
|
require('util')
|
||||||
require('settings')
|
require('settings')
|
||||||
require('mappings')
|
require('mappings')
|
||||||
|
|||||||
@@ -1,6 +1,3 @@
|
|||||||
local M = {}
|
|
||||||
|
|
||||||
function M.config()
|
|
||||||
vim.filetype.add({
|
vim.filetype.add({
|
||||||
extension = {
|
extension = {
|
||||||
yml = 'yaml',
|
yml = 'yaml',
|
||||||
@@ -17,6 +14,3 @@ function M.config()
|
|||||||
['*.env.*'] = 'env',
|
['*.env.*'] = 'env',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
|
||||||
|
|||||||
@@ -71,8 +71,8 @@ nmap('<leader>gb',':Git blame<CR>')
|
|||||||
nmap('<leader>a', ':A<CR>')
|
nmap('<leader>a', ':A<CR>')
|
||||||
|
|
||||||
-- test
|
-- test
|
||||||
-- nmap('<leader>r', ':TestFile<CR>')
|
nmap('<leader>r', ':TestFile<CR>')
|
||||||
-- nmap('<leader>R', ':TestSuite<CR>')
|
nmap('<leader>R', ':TestSuite<CR>')
|
||||||
|
|
||||||
-- CtrlSF
|
-- CtrlSF
|
||||||
nmap('<C-f>', '<Plug>CtrlSFPrompt')
|
nmap('<C-f>', '<Plug>CtrlSFPrompt')
|
||||||
|
|||||||
@@ -1,63 +0,0 @@
|
|||||||
local cmp = require 'cmp'
|
|
||||||
local luasnip = require 'luasnip'
|
|
||||||
|
|
||||||
local has_words_before = function()
|
|
||||||
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
|
|
||||||
return col ~= 0 and
|
|
||||||
vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(
|
|
||||||
col, col):match("%s") == nil
|
|
||||||
end
|
|
||||||
|
|
||||||
cmp.setup({
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
window = {
|
|
||||||
-- completion = cmp.config.window.bordered(),
|
|
||||||
documentation = cmp.config.window.bordered(),
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
|
||||||
['<C-e>'] = cmp.mapping.abort(),
|
|
||||||
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_next_item()
|
|
||||||
elseif luasnip.expand_or_jumpable() then
|
|
||||||
luasnip.expand_or_jump()
|
|
||||||
elseif has_words_before() then
|
|
||||||
cmp.complete()
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
["<S-Tab>"] = cmp.mapping(function(fallback)
|
|
||||||
if cmp.visible() then
|
|
||||||
cmp.select_prev_item()
|
|
||||||
elseif luasnip.jumpable(-1) then
|
|
||||||
luasnip.jump(-1)
|
|
||||||
else
|
|
||||||
fallback()
|
|
||||||
end
|
|
||||||
end, { "i", "s" }),
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = 'nvim_lsp' },
|
|
||||||
{ name = 'luasnip' }, -- For luasnip users.
|
|
||||||
}, {
|
|
||||||
{ name = 'buffer' },
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
-- Set up lspconfig.
|
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
|
||||||
-- require('lspconfig')['solargraph'].setup({ capabilities = capabilities })
|
|
||||||
|
|
||||||
-- require("luasnip.loaders.from_lua").lazy_load()
|
|
||||||
|
|
||||||
require('luasnip').filetype_extend("ruby", {"rails"})
|
|
||||||
require('luasnip.loaders.from_vscode').lazy_load()
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
vim.g.gitgutter_sign_added = '│'
|
|
||||||
vim.g.gitgutter_sign_modified = '│'
|
|
||||||
vim.g.gitgutter_sign_removed = '│'
|
|
||||||
vim.g.gitgutter_sign_modified_removed = '│'
|
|
||||||
vim.g.gitgutter_sign_removed_first_line = '│'
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
-- place this in one of your configuration file(s)
|
|
||||||
local hop = require('hop')
|
|
||||||
local directions = require('hop.hint').HintDirection
|
|
||||||
vim.keymap.set('', 'f', function()
|
|
||||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true })
|
|
||||||
end, {remap=true})
|
|
||||||
vim.keymap.set('', 'F', function()
|
|
||||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true })
|
|
||||||
end, {remap=true})
|
|
||||||
vim.keymap.set('', 't', function()
|
|
||||||
hop.hint_char1({ direction = directions.AFTER_CURSOR, current_line_only = true, hint_offset = -1 })
|
|
||||||
end, {remap=true})
|
|
||||||
vim.keymap.set('', 'T', function()
|
|
||||||
hop.hint_char1({ direction = directions.BEFORE_CURSOR, current_line_only = true, hint_offset = 1 })
|
|
||||||
end, {remap=true})
|
|
||||||
|
|
||||||
require'hop'.setup { keys = 'etovxqpdygfblzhckisuran' }
|
|
||||||
130
vim/.config/nvim/lua/plugins/init.lua
Normal file
130
vim/.config/nvim/lua/plugins/init.lua
Normal file
@@ -0,0 +1,130 @@
|
|||||||
|
local cmd, fn, opt, g = vim.cmd, vim.fn, vim.opt, vim.g
|
||||||
|
|
||||||
|
cmd [[packadd packer.nvim]]
|
||||||
|
local packer = require('packer')
|
||||||
|
local use = packer.use
|
||||||
|
|
||||||
|
-- NB: Difference between config and setup (https://github.com/wbthomason/packer.nvim#specifying-plugins)
|
||||||
|
--
|
||||||
|
-- `config` - Specifies code to run after this plugin is loaded.
|
||||||
|
--
|
||||||
|
-- The setup key implies opt = true
|
||||||
|
-- `setup` - Specifies code to run before this plugin is loaded. The code is ran even if
|
||||||
|
-- the plugin is waiting for other conditions (ft, cond...) to be met.
|
||||||
|
|
||||||
|
packer.startup(function()
|
||||||
|
use { 'wbthomason/packer.nvim', opt = true }
|
||||||
|
|
||||||
|
use 'lewis6991/impatient.nvim'
|
||||||
|
use 'nvim-lua/plenary.nvim'
|
||||||
|
|
||||||
|
use {
|
||||||
|
'shaunsingh/nord.nvim',
|
||||||
|
config = function()
|
||||||
|
require('plugins.nord').config()
|
||||||
|
end,
|
||||||
|
setup = function()
|
||||||
|
require('plugins.nord').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use {
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
run = ':TSUpdate',
|
||||||
|
event = { 'BufRead', 'BufNewFile' },
|
||||||
|
config = function()
|
||||||
|
require('plugins/treesitter').config()
|
||||||
|
end,
|
||||||
|
requires = {
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
|
after = 'nvim-treesitter'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-treesitter/playground',
|
||||||
|
cmd = 'TSPlaygroundToggle',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
use { 'nvim-tree/nvim-tree.lua',
|
||||||
|
config = function()
|
||||||
|
require('plugins/nvim-tree').config()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
use 'numtostr/comment.nvim'
|
||||||
|
use 'ellisonleao/glow.nvim'
|
||||||
|
|
||||||
|
use { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make', cond = fn.executable "make" == 1 }
|
||||||
|
use { 'nvim-telescope/telescope.nvim',
|
||||||
|
module = 'telescope',
|
||||||
|
requires = { 'nvim-lua/plenary.nvim' },
|
||||||
|
config = function()
|
||||||
|
require('plugins/telescope').config()
|
||||||
|
end,
|
||||||
|
setup = function()
|
||||||
|
require('plugins/telescope').setup()
|
||||||
|
end
|
||||||
|
}
|
||||||
|
|
||||||
|
-- Vimscript
|
||||||
|
use 'junegunn/vim-easy-align'
|
||||||
|
use 'christoomey/vim-tmux-navigator'
|
||||||
|
use 'lewis6991/gitsigns.nvim'
|
||||||
|
|
||||||
|
-- tpope
|
||||||
|
use 'tpope/vim-surround'
|
||||||
|
use 'tpope/vim-fugitive'
|
||||||
|
use 'tpope/vim-rails'
|
||||||
|
use 'tpope/vim-rhubarb'
|
||||||
|
use 'tpope/vim-repeat'
|
||||||
|
|
||||||
|
-- tests
|
||||||
|
use 'vim-test/vim-test'
|
||||||
|
use 'benmills/vimux'
|
||||||
|
|
||||||
|
-- TODO: find lua replacement / or learn :grep / cfdo
|
||||||
|
use 'dyng/ctrlsf.vim'
|
||||||
|
|
||||||
|
use 'andrewradev/splitjoin.vim'
|
||||||
|
|
||||||
|
use {
|
||||||
|
'VonHeikemen/lsp-zero.nvim',
|
||||||
|
branch = 'v1.x',
|
||||||
|
requires = {
|
||||||
|
-- LSP Support
|
||||||
|
{'neovim/nvim-lspconfig'}, -- Required
|
||||||
|
{ -- Optional
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
run = function()
|
||||||
|
pcall(vim.cmd, 'MasonUpdate')
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{'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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
use { "dstein64/vim-startuptime", cmd = "StartupTime" }
|
||||||
|
|
||||||
|
-- EXPERIMENTAL: trying out different plugins
|
||||||
|
use { 'skywind3000/asyncrun.vim' }
|
||||||
|
|
||||||
|
use {'kevinhwang91/nvim-bqf', ft = 'qf'} -- better qf
|
||||||
|
end)
|
||||||
|
|
||||||
|
require('plugins.lsp')
|
||||||
|
require('plugins.comment')
|
||||||
|
require('plugins.gitsigns')
|
||||||
@@ -78,25 +78,35 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
local lsp = require('lsp-zero')
|
-- local lsp = require('lsp-zero')
|
||||||
|
|
||||||
-- lsp.preset('recommended')
|
-- lsp.preset('recommended')
|
||||||
lsp.set_preferences({
|
-- lsp.set_preferences({
|
||||||
suggest_lsp_servers = true,
|
-- suggest_lsp_servers = true,
|
||||||
setup_servers_on_start = true,
|
-- setup_servers_on_start = true,
|
||||||
|
-- set_lsp_keymaps = true,
|
||||||
|
-- configure_diagnostics = true,
|
||||||
|
-- cmp_capabilities = true,
|
||||||
|
-- manage_nvim_cmp = true,
|
||||||
|
-- call_servers = 'local',
|
||||||
|
-- sign_icons = {
|
||||||
|
-- error = 'E',
|
||||||
|
-- warn = 'W',
|
||||||
|
-- hint = 'H',
|
||||||
|
-- info = 'I'
|
||||||
|
-- }
|
||||||
|
-- })
|
||||||
|
|
||||||
|
local lsp = require('lsp-zero').preset({
|
||||||
|
name = 'minimal',
|
||||||
set_lsp_keymaps = true,
|
set_lsp_keymaps = true,
|
||||||
configure_diagnostics = true,
|
|
||||||
cmp_capabilities = true,
|
|
||||||
manage_nvim_cmp = true,
|
manage_nvim_cmp = true,
|
||||||
call_servers = 'local',
|
suggest_lsp_servers = false,
|
||||||
sign_icons = {
|
|
||||||
error = 'E',
|
|
||||||
warn = 'W',
|
|
||||||
hint = 'H',
|
|
||||||
info = 'I'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- (Optional) Configure lua language server for neovim
|
||||||
|
-- lsp.nvim_workspace()
|
||||||
|
|
||||||
lsp.setup()
|
lsp.setup()
|
||||||
|
|
||||||
-- should be after setup
|
-- should be after setup
|
||||||
|
|||||||
@@ -1,11 +0,0 @@
|
|||||||
-- require("mason").setup({})
|
|
||||||
-- require("mason-tool-installer").setup({
|
|
||||||
-- -- https://github.com/williamboman/mason-lspconfig.nvim/blob/main/doc/server-mapping.md
|
|
||||||
-- ensure_installed = { "bash-language-server", "black", "dockerfile-language-server",
|
|
||||||
-- "isort", "json-lsp", "jsonlint", "lua-language-server", "marksman", "prettierd",
|
|
||||||
-- "python-lsp-server", "rubocop", "shfmt", "solargraph", "terraform-ls",
|
|
||||||
-- "vim-language-server", "yaml-language-server",
|
|
||||||
-- },
|
|
||||||
-- auto_update = true,
|
|
||||||
-- run_on_start = true
|
|
||||||
-- })
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
-- TODO: figure this out
|
|
||||||
local augroup = vim.api.nvim_create_augroup("LspFormatting", {})
|
|
||||||
require("null-ls").setup({
|
|
||||||
sources = {
|
|
||||||
require("null-ls").builtins.formatting.jq,
|
|
||||||
require("null-ls").builtins.formatting.gofmt,
|
|
||||||
require("null-ls").builtins.formatting.prettierd,
|
|
||||||
require("null-ls").builtins.formatting.terraform_fmt,
|
|
||||||
require("null-ls").builtins.diagnostics.jsonlint,
|
|
||||||
},
|
|
||||||
-- you can reuse a shared lspconfig on_attach callback here
|
|
||||||
on_attach = function(client, bufnr)
|
|
||||||
if client.supports_method("textDocument/formatting") then
|
|
||||||
vim.api.nvim_clear_autocmds({group = augroup, buffer = bufnr})
|
|
||||||
vim.api.nvim_create_autocmd("BufWritePre", {
|
|
||||||
group = augroup,
|
|
||||||
buffer = bufnr,
|
|
||||||
callback = function()
|
|
||||||
vim.lsp.buf.format({
|
|
||||||
bufnr = bufnr,
|
|
||||||
async = false,
|
|
||||||
filter = function(client)
|
|
||||||
return client.name == "null-ls"
|
|
||||||
end
|
|
||||||
})
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
})
|
|
||||||
@@ -1,3 +1,6 @@
|
|||||||
|
local M = {}
|
||||||
|
|
||||||
|
function M.config()
|
||||||
require("nvim-tree").setup({
|
require("nvim-tree").setup({
|
||||||
sort_by = "case_sensitive",
|
sort_by = "case_sensitive",
|
||||||
renderer = {
|
renderer = {
|
||||||
@@ -12,3 +15,6 @@ require("nvim-tree").setup({
|
|||||||
group_empty = true,
|
group_empty = true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
return M
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ function M.config()
|
|||||||
textobjects = { -- syntax-aware textobjects
|
textobjects = { -- syntax-aware textobjects
|
||||||
select = {
|
select = {
|
||||||
enable = true,
|
enable = true,
|
||||||
|
lookahead = true, -- Automatically jump forward to textobj, similar to targets.vim
|
||||||
disable = {},
|
disable = {},
|
||||||
keymaps = {
|
keymaps = {
|
||||||
-- You can use the capture groups defined in textobjects.scm
|
-- You can use the capture groups defined in textobjects.scm
|
||||||
@@ -48,6 +49,8 @@ function M.config()
|
|||||||
['im'] = '@call.inner',
|
['im'] = '@call.inner',
|
||||||
['ad'] = '@comment.outer',
|
['ad'] = '@comment.outer',
|
||||||
['id'] = '@comment.inner',
|
['id'] = '@comment.inner',
|
||||||
|
['aa'] = '@parameter.outer',
|
||||||
|
['ia'] = '@parameter.inner',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,16 +12,38 @@ opt.shiftwidth = 2 -- Numbers of spaces to (auto)indent
|
|||||||
opt.expandtab = true -- Tabs to spaces
|
opt.expandtab = true -- Tabs to spaces
|
||||||
opt.clipboard = 'unnamedplus' -- Share clipboard with the OS
|
opt.clipboard = 'unnamedplus' -- Share clipboard with the OS
|
||||||
opt.number = true -- Display line numbers
|
opt.number = true -- Display line numbers
|
||||||
|
|
||||||
|
-- opt.fillchars = {
|
||||||
|
-- vert = '▕', -- alternatives │
|
||||||
|
-- eob = ' ', -- suppress ~ at EndOfBuffer
|
||||||
|
-- msgsep = '‾',
|
||||||
|
-- diff = '⣿',
|
||||||
|
-- fold = ' ',
|
||||||
|
-- foldopen = '▾',
|
||||||
|
-- foldsep = '│',
|
||||||
|
-- foldclose = '▸',
|
||||||
|
-- }
|
||||||
|
--
|
||||||
|
opt.listchars = {
|
||||||
|
nbsp = '⦸', -- CIRCLED REVERSE SOLIDUS (U+29B8, UTF-8: E2 A6 B8)
|
||||||
|
extends = '»', -- RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00BB, UTF-8: C2 BB)
|
||||||
|
precedes = '«', -- LEFT-POINTING DOUBLE ANGLE QUOTATION MARK (U+00AB, UTF-8: C2 AB)
|
||||||
|
-- tab = ' ', -- '▷─' WHITE RIGHT-POINTING TRIANGLE (U+25B7, UTF-8: E2 96 B7) + BOX DRAWINGS HEAVY TRIPLE DASH HORIZONTAL (U+2505, UTF-8: E2 94 85)
|
||||||
|
trail = '•', -- BULLET (U+2022, UTF-8: E2 80 A2)
|
||||||
|
space = ' ',
|
||||||
|
}
|
||||||
|
|
||||||
opt.fillchars = {
|
opt.fillchars = {
|
||||||
vert = '▕', -- alternatives │
|
|
||||||
eob = ' ', -- suppress ~ at EndOfBuffer
|
|
||||||
msgsep = '‾',
|
|
||||||
diff = '⣿',
|
diff = '⣿',
|
||||||
fold = ' ',
|
eob = ' ', -- NO-BREAK SPACE (U+00A0, UTF-8: C2 A0) to suppress ~ at EndOfBuffer
|
||||||
|
vert = '│', -- window border when window splits vertically ─ ┴ ┬ ┤ ├ ┼
|
||||||
|
msgsep = '‾',
|
||||||
|
fold = '·', -- MIDDLE DOT (U+00B7, UTF-8: C2 B7)
|
||||||
foldopen = '▾',
|
foldopen = '▾',
|
||||||
foldsep = '│',
|
foldsep = '│',
|
||||||
foldclose = '▸',
|
foldclose = '▸'
|
||||||
}
|
}
|
||||||
|
|
||||||
opt.synmaxcol = 500 -- Do not try to highlight lines longer than 500 characters
|
opt.synmaxcol = 500 -- Do not try to highlight lines longer than 500 characters
|
||||||
opt.lazyredraw = true -- Do not redraw while running macros
|
opt.lazyredraw = true -- Do not redraw while running macros
|
||||||
opt.showmatch = true -- Show matching braces
|
opt.showmatch = true -- Show matching braces
|
||||||
@@ -86,7 +108,7 @@ opt.wildignore = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- vim-test
|
-- vim-test
|
||||||
g['test#strategy'] = 'neovim'
|
g['test#strategy'] = 'asyncrun_background'
|
||||||
|
|
||||||
-- CtrlSF
|
-- CtrlSF
|
||||||
g.ctrlsf_ackprg = 'rg'
|
g.ctrlsf_ackprg = 'rg'
|
||||||
|
|||||||
@@ -79,6 +79,11 @@ _G.packer_plugins = {
|
|||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/LuaSnip",
|
||||||
url = "https://github.com/L3MON4D3/LuaSnip"
|
url = "https://github.com/L3MON4D3/LuaSnip"
|
||||||
},
|
},
|
||||||
|
["asyncrun.vim"] = {
|
||||||
|
loaded = true,
|
||||||
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/asyncrun.vim",
|
||||||
|
url = "https://github.com/skywind3000/asyncrun.vim"
|
||||||
|
},
|
||||||
["cmp-buffer"] = {
|
["cmp-buffer"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||||
@@ -129,11 +134,6 @@ _G.packer_plugins = {
|
|||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/glow.nvim",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/glow.nvim",
|
||||||
url = "https://github.com/ellisonleao/glow.nvim"
|
url = "https://github.com/ellisonleao/glow.nvim"
|
||||||
},
|
},
|
||||||
["hop.nvim"] = {
|
|
||||||
loaded = true,
|
|
||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/hop.nvim",
|
|
||||||
url = "https://github.com/phaazon/hop.nvim"
|
|
||||||
},
|
|
||||||
["impatient.nvim"] = {
|
["impatient.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/impatient.nvim",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/impatient.nvim",
|
||||||
@@ -142,7 +142,7 @@ _G.packer_plugins = {
|
|||||||
["lsp-zero.nvim"] = {
|
["lsp-zero.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/lsp-zero.nvim",
|
||||||
url = "https://github.com/vonheikemen/lsp-zero.nvim"
|
url = "https://github.com/VonHeikemen/lsp-zero.nvim"
|
||||||
},
|
},
|
||||||
["mason-lspconfig.nvim"] = {
|
["mason-lspconfig.nvim"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
@@ -161,6 +161,13 @@ _G.packer_plugins = {
|
|||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/opt/nord.nvim",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/opt/nord.nvim",
|
||||||
url = "https://github.com/shaunsingh/nord.nvim"
|
url = "https://github.com/shaunsingh/nord.nvim"
|
||||||
},
|
},
|
||||||
|
["nvim-bqf"] = {
|
||||||
|
loaded = false,
|
||||||
|
needs_bufread = true,
|
||||||
|
only_cond = false,
|
||||||
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/opt/nvim-bqf",
|
||||||
|
url = "https://github.com/kevinhwang91/nvim-bqf"
|
||||||
|
},
|
||||||
["nvim-cmp"] = {
|
["nvim-cmp"] = {
|
||||||
loaded = true,
|
loaded = true,
|
||||||
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
path = "/Users/madundead/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||||
@@ -340,13 +347,6 @@ time([[Conditional loading of telescope-fzf-native.nvim]], false)
|
|||||||
|
|
||||||
-- Command lazy-loads
|
-- Command lazy-loads
|
||||||
time([[Defining lazy-load commands]], true)
|
time([[Defining lazy-load commands]], true)
|
||||||
pcall(vim.api.nvim_create_user_command, 'TSPlaygroundToggle', function(cmdargs)
|
|
||||||
require('packer.load')({'playground'}, { cmd = 'TSPlaygroundToggle', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
|
|
||||||
end,
|
|
||||||
{nargs = '*', range = true, bang = true, complete = function()
|
|
||||||
require('packer.load')({'playground'}, {}, _G.packer_plugins)
|
|
||||||
return vim.fn.getcompletion('TSPlaygroundToggle ', 'cmdline')
|
|
||||||
end})
|
|
||||||
pcall(vim.api.nvim_create_user_command, 'StartupTime', function(cmdargs)
|
pcall(vim.api.nvim_create_user_command, 'StartupTime', function(cmdargs)
|
||||||
require('packer.load')({'vim-startuptime'}, { cmd = 'StartupTime', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
|
require('packer.load')({'vim-startuptime'}, { cmd = 'StartupTime', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
|
||||||
end,
|
end,
|
||||||
@@ -354,10 +354,21 @@ pcall(vim.api.nvim_create_user_command, 'StartupTime', function(cmdargs)
|
|||||||
require('packer.load')({'vim-startuptime'}, {}, _G.packer_plugins)
|
require('packer.load')({'vim-startuptime'}, {}, _G.packer_plugins)
|
||||||
return vim.fn.getcompletion('StartupTime ', 'cmdline')
|
return vim.fn.getcompletion('StartupTime ', 'cmdline')
|
||||||
end})
|
end})
|
||||||
|
pcall(vim.api.nvim_create_user_command, 'TSPlaygroundToggle', function(cmdargs)
|
||||||
|
require('packer.load')({'playground'}, { cmd = 'TSPlaygroundToggle', l1 = cmdargs.line1, l2 = cmdargs.line2, bang = cmdargs.bang, args = cmdargs.args, mods = cmdargs.mods }, _G.packer_plugins)
|
||||||
|
end,
|
||||||
|
{nargs = '*', range = true, bang = true, complete = function()
|
||||||
|
require('packer.load')({'playground'}, {}, _G.packer_plugins)
|
||||||
|
return vim.fn.getcompletion('TSPlaygroundToggle ', 'cmdline')
|
||||||
|
end})
|
||||||
time([[Defining lazy-load commands]], false)
|
time([[Defining lazy-load commands]], false)
|
||||||
|
|
||||||
vim.cmd [[augroup packer_load_aucmds]]
|
vim.cmd [[augroup packer_load_aucmds]]
|
||||||
vim.cmd [[au!]]
|
vim.cmd [[au!]]
|
||||||
|
-- Filetype lazy-loads
|
||||||
|
time([[Defining lazy-load filetype autocommands]], true)
|
||||||
|
vim.cmd [[au FileType qf ++once lua require("packer.load")({'nvim-bqf'}, { ft = "qf" }, _G.packer_plugins)]]
|
||||||
|
time([[Defining lazy-load filetype autocommands]], false)
|
||||||
-- Event lazy-loads
|
-- Event lazy-loads
|
||||||
time([[Defining lazy-load event autocommands]], true)
|
time([[Defining lazy-load event autocommands]], true)
|
||||||
vim.cmd [[au BufRead * ++once lua require("packer.load")({'nvim-treesitter'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
vim.cmd [[au BufRead * ++once lua require("packer.load")({'nvim-treesitter'}, { event = "BufRead *" }, _G.packer_plugins)]]
|
||||||
|
|||||||
Reference in New Issue
Block a user