Skip to content

Commit 9458e4a

Browse files
update my nvim configuration
1 parent bb0f285 commit 9458e4a

File tree

15 files changed

+127
-9
lines changed

15 files changed

+127
-9
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
; extends
2+
((inline) @injection.content
3+
(#lua-match? @injection.content "^%s*import")
4+
(#set! injection.language "typescript"))
5+
((inline) @injection.content
6+
(#lua-match? @injection.content "^%s*export")
7+
(#set! injection.language "typescript"))

Dotfiles/nvim/init.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
require("ro.core")
22
require("ro.lazy")
3+
require("ro.conf")

Dotfiles/nvim/lazy-lock.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
1111
"conform.nvim": { "branch": "master", "commit": "d2a54aa54d84117ac3d99afdd527281f81e9e2c9" },
1212
"dressing.nvim": { "branch": "master", "commit": "5162edb1442a729a885c45455a07e9a89058be2f" },
13+
"eskk.vim": { "branch": "master", "commit": "a2a722c1c020748249a1f04b788cecd4f509202b" },
1314
"friendly-snippets": { "branch": "main", "commit": "3e9a3f5a0cfcef1741e352c37bda4e82e5eb846a" },
15+
"git-blame.nvim": { "branch": "master", "commit": "fb84fad97cd4b51caee3c865e8a33a0d413b77a8" },
1416
"gitsigns.nvim": { "branch": "main", "commit": "805610a9393fa231f2c2b49cb521bfa413fadb3d" },
17+
"harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" },
1518
"hover.nvim": { "branch": "main", "commit": "82684ebd5f2a812d6d05a629b14109618b54cbfc" },
1619
"indent-blankline.nvim": { "branch": "master", "commit": "3d08501caef2329aba5121b753e903904088f7e6" },
1720
"lazy.nvim": { "branch": "main", "commit": "bef521ac89c8d423f9d092e37b58e8af0c099309" },

Dotfiles/nvim/lua/ro/conf.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
-- support for mdx parser
2+
local ft_to_parser = require("nvim-treesitter.parsers").filetype_to_parsername
3+
ft_to_parser.mdx = "markdown"

Dotfiles/nvim/lua/ro/core/keymaps.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ keymap.set("i", "jk", "<ESC>", { desc = "Exit insert mode with jk" })
66

77
keymap.set("n", "<leader>nh", ":nohl<CR>", { desc = "Clear search highlights" })
88

9+
-- Set the first option as default in autocomplete menu
10+
keymap.set("i", "<CR>", 'pumvisible() ? "\\<C-y><CR>" : "\\<CR>"', { expr = true })
11+
912
-- increment/decrement numbers
1013
keymap.set("n", "<leader>+", "<C-a>", { desc = "Increment number" }) -- increment
1114
keymap.set("n", "<leader>-", "<C-x>", { desc = "Decrement number" }) -- decrement
@@ -14,7 +17,7 @@ keymap.set("n", "<C-s>", "<C-^>") -- toggle last file
1417
keymap.set("n", "zz", "<Esc>:update<cr>")
1518
keymap.set("i", "zz", "<Esc>:update<cr>")
1619
keymap.set("n", ";", "<S-$>") -- Go to end of line
17-
keymap.set("n", ",,", "<cmd>NvimTreeToggle<cr>")
20+
keymap.set("n", ",,", "<cmd>NvimTreeFindFileToggle<cr>")
1821

1922
-- window management
2023
keymap.set("n", "<leader>sv", "<C-w>v", { desc = "Split window vertically" }) -- split window vertically

Dotfiles/nvim/lua/ro/core/options.lua

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,25 @@ opt.splitbelow = true -- split horizontal window to the bottom
3737

3838
-- turn off swapfile
3939
opt.swapfile = false
40+
41+
-- wrap lines
42+
opt.textwidth = 0
43+
opt.wrapmargin = 0
44+
opt.wrap = true
45+
opt.linebreak = true
46+
47+
--spellcheck
48+
opt.spelllang = "en,es,cjk"
49+
opt.spell = true
50+
51+
-- mdx support
52+
vim.filetype.add({
53+
extension = {
54+
mdx = "mdx",
55+
},
56+
})
57+
58+
-- remember last position
59+
vim.cmd([[if has("autocmd")
60+
au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
61+
endif]])
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
"f-person/git-blame.nvim",
3+
}
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
return {
2+
"ThePrimeagen/harpoon",
3+
branch = "harpoon2",
4+
dependencies = { "nvim-lua/plenary.nvim" },
5+
config = function()
6+
local harpoon = require("harpoon")
7+
harpoon:setup({})
8+
9+
-- basic telescope configuration
10+
local conf = require("telescope.config").values
11+
local function toggle_telescope(harpoon_files)
12+
local file_paths = {}
13+
for _, item in ipairs(harpoon_files.items) do
14+
table.insert(file_paths, item.value)
15+
end
16+
17+
require("telescope.pickers")
18+
.new({}, {
19+
prompt_title = "Harpoon",
20+
finder = require("telescope.finders").new_table({
21+
results = file_paths,
22+
}),
23+
previewer = conf.file_previewer({}),
24+
sorter = conf.generic_sorter({}),
25+
})
26+
:find()
27+
end
28+
29+
vim.keymap.set("n", "<leader>fh", function()
30+
toggle_telescope(harpoon:list())
31+
end, { desc = "Open harpoon window" })
32+
33+
vim.keymap.set("n", "<leader>a", function()
34+
harpoon:list():add()
35+
end)
36+
vim.keymap.set("n", "<C-e>", function()
37+
harpoon.ui:toggle_quick_menu(harpoon:list())
38+
end)
39+
40+
vim.keymap.set("n", "<C-j>", function()
41+
harpoon:list():select(1)
42+
end)
43+
vim.keymap.set("n", "<C-k>", function()
44+
harpoon:list():select(2)
45+
end)
46+
vim.keymap.set("n", "<C-l>", function()
47+
harpoon:list():select(3)
48+
end)
49+
vim.keymap.set("n", "<C-;>", function()
50+
harpoon:list():select(4)
51+
end)
52+
53+
-- Toggle previous & next buffers stored within Harpoon list
54+
vim.keymap.set("n", "<C-n>", function()
55+
harpoon:list():prev()
56+
end)
57+
vim.keymap.set("n", "<C-p>", function()
58+
harpoon:list():next()
59+
end)
60+
end,
61+
}

Dotfiles/nvim/lua/ro/plugins/hover.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,6 @@ return {
3737

3838
-- Mouse support
3939
vim.keymap.set("n", "<MouseMove>", require("hover").hover_mouse, { desc = "hover.nvim (mouse)" })
40-
vim.o.mousemoveevent = true
40+
vim.o.mousemoveevent = false
4141
end,
4242
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
return {
2+
"tyru/eskk.vim",
3+
}

0 commit comments

Comments
 (0)