1
0
mirror of https://github.com/jdhao/nvim-config.git synced 2025-06-08 14:14:33 +02:00

5 Commits

Author SHA1 Message Date
jdhao
696466469b update spell 2022-10-05 23:01:23 +08:00
jdhao
7a5be43600 use lua func in rhs instead of callback 2022-10-05 22:42:02 +08:00
jdhao
3b39067097 update mousescroll 2022-10-05 22:39:13 +08:00
jdhao
e6b3be0777 remove language workaround for macOS
The issue has been fixed in https://github.com/neovim/neovim/pull/19139.
2022-10-05 22:33:13 +08:00
jdhao
acb423984a remove vim-asterisk
The * can now search selected text by default. The cursor stay feature
can also be simulated.
2022-10-05 12:42:45 +08:00
6 changed files with 35 additions and 26 deletions

View File

@@ -43,9 +43,7 @@ vim.g.mapleader = ','
vim.g.vimsyn_embed = 'l'
-- Use English as main language
if not vim.g.is_mac then
vim.cmd [[language en_US.utf-8]]
end
-- Disable loading certain plugins

View File

@@ -85,16 +85,15 @@ keymap.set("n", "<leader>ev", "<cmd>tabnew $MYVIMRC <bar> tcd %:h<cr>", {
desc = "open init.lua",
})
keymap.set("n", "<leader>sv", "", {
silent = true,
desc = "reload init.lua",
callback = function()
keymap.set("n", "<leader>sv", function()
vim.cmd([[
update $MYVIMRC
source $MYVIMRC
]])
vim.notify("Nvim config successfully reloaded!", vim.log.levels.INFO, { title = "nvim-config" })
end,
end, {
silent = true,
desc = "reload init.lua",
})
-- Reselect the text that has just been pasted, see also https://stackoverflow.com/a/4317090/6064933.
@@ -173,25 +172,23 @@ keymap.set({ "x", "o" }, "iu", "<cmd>call text_obj#URL()<cr>", { desc = "URL tex
keymap.set({ "x", "o" }, "iB", "<cmd>call text_obj#Buffer()<cr>", { desc = "buffer text object" })
-- Do not move my cursor when joining lines.
keymap.set("n", "J", "", {
desc = "join line",
callback = function()
keymap.set("n", "J", function()
vim.cmd([[
normal! mzJ`z
delmarks z
]])
end,
end, {
desc = "join line",
})
keymap.set("n", "gJ", "mzgJ`z", {
desc = "join visual lines",
callback = function()
keymap.set("n", "gJ", function()
-- we must use `normal!`, otherwise it will trigger recursive mapping
vim.cmd([[
normal! zmgJ`z
delmarks z
]])
end,
end, {
desc = "join visual lines",
})
-- Break inserted text into smaller undo units when we insert some punctuation chars.

View File

@@ -75,6 +75,7 @@ set scrolloff=3
" Use mouse to select and resize windows, etc.
set mouse=nic " Enable mouse in several mode
set mousemodel=popup " Set the behaviour of mouse
set mousescroll=ver:1,hor:6
" Disable showing current mode on command line since statusline plugins can show it.
set noshowmode

View File

@@ -34,5 +34,15 @@ keymap.set("n", "N", "", {
end,
})
keymap.set("n", "*", "<Plug>(asterisk-z*)<Cmd>lua require('hlslens').start()<CR>")
keymap.set("n", "#", "<Plug>(asterisk-z#)<Cmd>lua require('hlslens').start()<CR>")
keymap.set("n", "*", "", {
callback = function()
vim.fn.execute("normal! *N")
hlslens.start()
end,
})
keymap.set("n", "#", "", {
callback = function()
vim.fn.execute("normal! #N")
hlslens.start()
end,
})

View File

@@ -99,9 +99,6 @@ packer.startup {
config = [[require('config.hlslens')]],
}
-- Stay after pressing * and search selected text
use { "haya14busa/vim-asterisk", event = "VimEnter" }
-- File search, tag search and more
if vim.g.is_win then
use { "Yggdroot/LeaderF", cmd = "Leaderf" }

View File

@@ -440,3 +440,9 @@ Postgres
plpgsql
postgres
PySpark
winbar
cmdline
shada
async
localhost
JetBrains