add hop and neogen
This commit is contained in:
parent
8cdc7e2373
commit
6d29e4da7d
|
@ -7,9 +7,7 @@ set.list = true
|
||||||
set.swapfile = false
|
set.swapfile = false
|
||||||
set.writebackup = false
|
set.writebackup = false
|
||||||
set.wrap = false
|
set.wrap = false
|
||||||
-- vim.o.sessionoptions = "resize,winpos,winsize,buffers,tabpages,folds,curdir,help"
|
|
||||||
set.shiftwidth = 2
|
set.shiftwidth = 2
|
||||||
-- vim.o.showmode = true
|
|
||||||
set.splitbelow = true
|
set.splitbelow = true
|
||||||
set.splitright = true
|
set.splitright = true
|
||||||
set.tabstop = 2
|
set.tabstop = 2
|
||||||
|
@ -20,19 +18,10 @@ vim.keymap.set('n', 'H', 'gT', { desc = 'Tab Left' })
|
||||||
vim.keymap.set('n', 'L', 'gt', { desc = 'Tab Right' })
|
vim.keymap.set('n', 'L', 'gt', { desc = 'Tab Right' })
|
||||||
|
|
||||||
-- line bubbling
|
-- line bubbling
|
||||||
|
|
||||||
-- nnoremap <C-j> :m .+1<CR>==
|
|
||||||
-- nnoremap <C-k> :m .-2<CR>==
|
|
||||||
vim.keymap.set('n', '<C-j>', ':m .+1<CR>==', { noremap = true, desc = 'Bubble Down' })
|
vim.keymap.set('n', '<C-j>', ':m .+1<CR>==', { noremap = true, desc = 'Bubble Down' })
|
||||||
vim.keymap.set('n', '<C-k>', ':m .-2<CR>==', { noremap = true, desc = 'Bubble Up' }) -- conflicts with "signature help" from LSP
|
vim.keymap.set('n', '<C-k>', ':m .-2<CR>==', { noremap = true, desc = 'Bubble Up' }) -- conflicts with "signature help" from LSP
|
||||||
|
|
||||||
-- inoremap <C-j> <ESC>:m .+1<CR>==gi
|
|
||||||
-- inoremap <C-k> <ESC>:m .-2<CR>==gi
|
|
||||||
vim.keymap.set('i', '<C-j>', '<ESC>:m .+1<CR>==gi', { noremap = true, desc = 'Bubble Down' })
|
vim.keymap.set('i', '<C-j>', '<ESC>:m .+1<CR>==gi', { noremap = true, desc = 'Bubble Down' })
|
||||||
vim.keymap.set('i', '<C-k>', '<ESC>:m .-2<CR>==gi', { noremap = true, desc = 'Bubble Up' })
|
vim.keymap.set('i', '<C-k>', '<ESC>:m .-2<CR>==gi', { noremap = true, desc = 'Bubble Up' })
|
||||||
|
|
||||||
-- vnoremap <C-j> :m '>+1<CR>gv=gv
|
|
||||||
-- vnoremap <C-k> :m '<-2<CR>gv=gv
|
|
||||||
vim.keymap.set('v', '<C-k>', ":m '<-2<CR>gv=gv", { noremap = true, desc = 'Bubble Down' })
|
vim.keymap.set('v', '<C-k>', ":m '<-2<CR>gv=gv", { noremap = true, desc = 'Bubble Down' })
|
||||||
vim.keymap.set('v', '<C-j>', ":m '>+1<CR>gv=gv", { noremap = true, desc = 'Bubble Up' })
|
vim.keymap.set('v', '<C-j>', ":m '>+1<CR>gv=gv", { noremap = true, desc = 'Bubble Up' })
|
||||||
|
|
||||||
|
@ -49,13 +38,11 @@ vim.diagnostic.config({
|
||||||
},
|
},
|
||||||
float = {
|
float = {
|
||||||
source = "always",
|
source = "always",
|
||||||
-- close_events = { 'BufLeave', 'CursorMoved', 'InsertEnter', 'FocusLost' },
|
|
||||||
format = function(diagnostic)
|
format = function(diagnostic)
|
||||||
if diagnostic.source == 'eslint' then
|
if diagnostic.source == 'eslint' then
|
||||||
return string.format(
|
return string.format(
|
||||||
'%s [%s]',
|
'%s [%s]',
|
||||||
diagnostic.message,
|
diagnostic.message,
|
||||||
-- shows the name of the rule
|
|
||||||
diagnostic.user_data.lsp.code
|
diagnostic.user_data.lsp.code
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
@ -74,9 +61,7 @@ end
|
||||||
-- null-ls
|
-- null-ls
|
||||||
-- @see: https://github.com/jay-babu/mason-null-ls.nvim
|
-- @see: https://github.com/jay-babu/mason-null-ls.nvim
|
||||||
-- might want to just use mason-null-ls. not yet sure what the advantage is.
|
-- might want to just use mason-null-ls. not yet sure what the advantage is.
|
||||||
|
|
||||||
local null_ls = require("null-ls")
|
local null_ls = require("null-ls")
|
||||||
|
|
||||||
null_ls.setup({
|
null_ls.setup({
|
||||||
sources = {
|
sources = {
|
||||||
null_ls.builtins.formatting.prettierd,
|
null_ls.builtins.formatting.prettierd,
|
||||||
|
@ -91,4 +76,25 @@ cmp.event:on(
|
||||||
cmp_autopairs.on_confirm_done()
|
cmp_autopairs.on_confirm_done()
|
||||||
)
|
)
|
||||||
|
|
||||||
|
-- neogen
|
||||||
|
vim.keymap.set('n', '<leader>nf', ":Neogen func<CR>", { noremap = true, desc = '[D]ocument [F]unction' })
|
||||||
|
|
||||||
|
-- hop
|
||||||
|
local hop = require('hop')
|
||||||
|
local directions = require('hop.hint').HintDirection
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
'',
|
||||||
|
'h',
|
||||||
|
function() hop.hint_char1({ direction = directions.AFTER_CURSOR }) end,
|
||||||
|
{ remap = true }
|
||||||
|
)
|
||||||
|
|
||||||
|
vim.keymap.set(
|
||||||
|
'',
|
||||||
|
'H',
|
||||||
|
function() hop.hint_char1({ direction = directions.BEFORE_CURSOR }) end,
|
||||||
|
{ remap = true }
|
||||||
|
)
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
|
|
@ -4,14 +4,29 @@ return {
|
||||||
{ "tpope/vim-eunuch", },
|
{ "tpope/vim-eunuch", },
|
||||||
{ "tpope/vim-repeat", },
|
{ "tpope/vim-repeat", },
|
||||||
{ "tpope/vim-surround" },
|
{ "tpope/vim-surround" },
|
||||||
|
{ "tribela/vim-transparent" },
|
||||||
|
|
||||||
{
|
{
|
||||||
"nvim-tree/nvim-web-devicons",
|
"nvim-tree/nvim-web-devicons",
|
||||||
opts = {}
|
opts = {}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
"danymat/neogen",
|
||||||
|
dependencies = "nvim-treesitter/nvim-treesitter",
|
||||||
|
config = true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'phaazon/hop.nvim',
|
||||||
|
branch = 'v2',
|
||||||
|
config = function()
|
||||||
|
require 'hop'.setup {}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
"windwp/nvim-autopairs",
|
"windwp/nvim-autopairs",
|
||||||
|
lazy = true,
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-autopairs").setup {}
|
require("nvim-autopairs").setup {}
|
||||||
end,
|
end,
|
||||||
|
@ -23,6 +38,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"jose-elias-alvarez/null-ls.nvim",
|
"jose-elias-alvarez/null-ls.nvim",
|
||||||
|
lazy = true,
|
||||||
dependencies = { "nvim-lua/plenary.nvim" },
|
dependencies = { "nvim-lua/plenary.nvim" },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue