Compare commits
4
Commits
d7317fc336
..
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
352f3e8280 | ||
|
|
3680ad5fa8 | ||
|
|
8fe8988de0 | ||
|
|
50ba3ef8a1 |
@@ -2,4 +2,3 @@ require("config")
|
||||
require("plugins")
|
||||
|
||||
require("vim._core.ui2").enable()
|
||||
|
||||
|
||||
+5
-2
@@ -49,6 +49,9 @@ vim.opt.smartindent = true
|
||||
-- Makes <Tab> insert 'shiftwidth' number of spaces at the start of a line
|
||||
vim.opt.smarttab = true
|
||||
|
||||
-- Copy indent from current line when starting a new lin
|
||||
vim.opt.autoindent = true
|
||||
|
||||
-- Incremental and highlight search
|
||||
vim.opt.hlsearch = false
|
||||
vim.opt.incsearch = true
|
||||
@@ -76,8 +79,8 @@ vim.keymap.set("n", "<C-d>", "<C-d>zz")
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz")
|
||||
|
||||
-- Center when moving
|
||||
vim.keymap.set("n", "n", "nzzzv")
|
||||
vim.keymap.set("n", "N", "Nzzzv")
|
||||
-- vim.keymap.set("n", "n", "nzzzv")
|
||||
-- vim.keymap.set("n", "N", "Nzzzv")
|
||||
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
|
||||
@@ -16,3 +16,4 @@ vim.keymap.set({ "n", "x", "o" }, "S", function() Flash.treesitter() end)
|
||||
vim.keymap.set({ "o" }, "r", function() Flash.remote() end)
|
||||
vim.keymap.set({ "o", "x" }, "R", function() Flash.treesitter_search() end)
|
||||
vim.keymap.set({ "c" }, "<c-s>", function() Flash.toggle() end)
|
||||
-- vim.keymap.set({"n"}, "")
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
require("plugins.colorscheme")
|
||||
require("plugins.multicursors")
|
||||
require("plugins.telescope")
|
||||
require("plugins.treesitter")
|
||||
require("plugins.lsp")
|
||||
require("plugins.oil")
|
||||
require("plugins.cmp")
|
||||
require("plugins.multicursor")
|
||||
require("plugins.lsplines")
|
||||
require("plugins.mini")
|
||||
require("plugins.flash")
|
||||
|
||||
+3
-2
@@ -7,10 +7,11 @@ vim.lsp.enable({ 'lua_ls' })
|
||||
vim.lsp.enable({ 'clangd' })
|
||||
vim.lsp.enable({ 'spade_ls' })
|
||||
vim.lsp.enable({ 'pyright' })
|
||||
-- vim.lsp.enable({ 'harper_ls' })
|
||||
vim.lsp.enable({ 'tinymist' })
|
||||
vim.lsp.config('wgsl_analyzer', { filetypes = { "wgsl", "wesl" } })
|
||||
vim.lsp.enable('wgsl_analyzer')
|
||||
vim.lsp.enable({ 'jdtls' })
|
||||
vim.lsp.enable({ 'slangd' })
|
||||
vim.lsp.semantic_tokens.enable(false)
|
||||
|
||||
vim.lsp.config("rust_analyzer", {
|
||||
settings = {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
vim.pack.add({ "https://github.com/scalameta/nvim-metals" })
|
||||
--[[
|
||||
local metals_config = require("metals").bare_config()
|
||||
|
||||
metals_config.capabilities = require("blink.cmp").get_lsp_capabilities()
|
||||
@@ -38,3 +39,4 @@ vim.api.nvim_create_autocmd("FileType", {
|
||||
end,
|
||||
group = nvim_metals_group,
|
||||
})
|
||||
]] --
|
||||
|
||||
@@ -1,7 +1,57 @@
|
||||
vim.pack.add({ "https://github.com/jake-stewart/multicursor.nvim" })
|
||||
vim.pack.add({ { src = 'https://github.com/jake-stewart/multicursor.nvim', version = 'native' } })
|
||||
--[[
|
||||
local ns = vim.api.nvim_create_namespace('nvim.multicursor')
|
||||
|
||||
local function word_pat()
|
||||
local w = vim.fn.expand('<cword>')
|
||||
if w == '' then return end
|
||||
return '\\V\\<' .. vim.fn.escape(w, '\\') .. '\\>'
|
||||
end
|
||||
|
||||
-- Moving the main cursor would drag every cursor along in follow mode,
|
||||
-- so switch it off for the move, then re-enable it.
|
||||
local function without_follow(fn)
|
||||
vim.cmd('normal! 2q=')
|
||||
fn()
|
||||
vim.schedule(function() vim.cmd('normal! 1q=') end)
|
||||
end
|
||||
|
||||
-- Add a cursor on the current word, then jump to the next/previous match
|
||||
local function add_match(dir)
|
||||
return function()
|
||||
local pat = word_pat()
|
||||
if not pat then return end
|
||||
without_follow(function()
|
||||
vim.fn.searchpos(pat, 'bcW') -- go to start of the word
|
||||
vim.api.nvim_mcursor(0, vim.api.nvim_win_get_cursor(0))
|
||||
vim.fn.searchpos(pat, dir > 0 and 'w' or 'bw')
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
-- Jump to the next/previous match and remove the cursor sitting there
|
||||
local function remove_match(dir)
|
||||
return function()
|
||||
local pat = word_pat()
|
||||
if not pat then return end
|
||||
without_follow(function()
|
||||
local pos = vim.fn.searchpos(pat, dir > 0 and 'w' or 'bw')
|
||||
local r, c = pos[1] - 1, pos[2] - 1
|
||||
for _, m in ipairs(vim.api.nvim_buf_get_extmarks(0, ns, { r, c }, { r, c }, {})) do
|
||||
vim.api.nvim_buf_del_extmark(0, ns, m[1])
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
vim.keymap.set({ 'n' }, '<C-j>', add_match(1), { desc = 'MC: add cursor, next match' })
|
||||
vim.keymap.set({ 'n' }, '<C-k>', add_match(-1), { desc = 'MC: add cursor, prev match' })
|
||||
vim.keymap.set({ 'n' }, '<C-S-j>', remove_match(1), { desc = 'MC: remove cursor, next match' })
|
||||
vim.keymap.set({ 'n' }, '<C-S-k>', remove_match(-1), { desc = 'MC: remove cursor, prev match' })
|
||||
]] --
|
||||
|
||||
local mc = require("multicursor-nvim")
|
||||
mc.setup()
|
||||
mc.setup({native = false})
|
||||
|
||||
local set = vim.keymap.set
|
||||
|
||||
@@ -18,6 +18,7 @@ vim.keymap.set("n", "<leader>pf", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<leader>pb", builtin.buffers, {})
|
||||
vim.keymap.set("n", "<leader>ps", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<leader>pd", builtin.diagnostics, {})
|
||||
vim.keymap.set("n", "<leader>pu", builtin.lsp_references, {})
|
||||
|
||||
-- fzf
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
@@ -63,8 +63,8 @@ local languages =
|
||||
"yaml",
|
||||
"wgsl",
|
||||
"spade",
|
||||
"scala",
|
||||
"typst",
|
||||
"java",
|
||||
"slang"
|
||||
}
|
||||
|
||||
@@ -73,7 +73,10 @@ ts.install(languages):wait(300000)
|
||||
for _, lang in pairs(languages) do
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = { lang },
|
||||
callback = function() vim.treesitter.start() end,
|
||||
callback = function()
|
||||
vim.treesitter.start()
|
||||
--vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
+22
-17
@@ -5,31 +5,31 @@
|
||||
"src": "https://github.com/numToStr/Comment.nvim"
|
||||
},
|
||||
"blink.cmp": {
|
||||
"rev": "91774548bc358c02fcc327d33c9ac0d9830c8c47",
|
||||
"rev": "eece1c590dc575d489589c95499ec3acbf004e42",
|
||||
"src": "https://github.com/saghen/blink.cmp"
|
||||
},
|
||||
"blink.lib": {
|
||||
"rev": "b127d48bf8e9ac9cf41f6e0fbead317503f76558",
|
||||
"rev": "fd9a48ebbe6ec30d5dfcc5b42c243941ccdca1aa",
|
||||
"src": "https://github.com/saghen/blink.lib"
|
||||
},
|
||||
"colorful-menu.nvim": {
|
||||
"rev": "13f9b7eaa9cd2901b4f8915cfb2483c3be4c8c20",
|
||||
"rev": "196ddf16d5f8fec09ba7f20e6b153aa5188e907b",
|
||||
"src": "https://github.com/xzbdmw/colorful-menu.nvim"
|
||||
},
|
||||
"conform.nvim": {
|
||||
"rev": "619363c30309d29ffa631e67c8183f2a72caa373",
|
||||
"rev": "016802de402556da54c36bd7359b441266b01cdd",
|
||||
"src": "https://github.com/stevearc/conform.nvim"
|
||||
},
|
||||
"fidget.nvim": {
|
||||
"rev": "82404b196e73a00b1727a91903beef5ddc319d22",
|
||||
"rev": "9e0201673e08e997e7cf52afca5565c70bd117f3",
|
||||
"src": "https://github.com/j-hui/fidget.nvim"
|
||||
},
|
||||
"flash.nvim": {
|
||||
"rev": "fcea7ff883235d9024dc41e638f164a450c14ca2",
|
||||
"rev": "5f0f270fdc7c5b0c21d903ee85b9cb06f2ac636a",
|
||||
"src": "https://github.com/folke/flash.nvim"
|
||||
},
|
||||
"gitsigns.nvim": {
|
||||
"rev": "25050e4ed39e628282831d4cbecb1850454ce915",
|
||||
"rev": "1e9d0fbfe7ff848bc402d2c2e2854fb4eff2dce7",
|
||||
"src": "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
"lsp_lines.nvim": {
|
||||
@@ -40,6 +40,10 @@
|
||||
"rev": "9c60ec2279d62487d942ce095e49006af28eed6e",
|
||||
"src": "https://github.com/rktjmp/lush.nvim"
|
||||
},
|
||||
"mc-cavallo.nvim": {
|
||||
"rev": "1f3b6a1919f0c4b4c6149baa8eb77dfb8659557c",
|
||||
"src": "https://github.com/colomb8/mc-cavallo.nvim"
|
||||
},
|
||||
"melange-nvim": {
|
||||
"rev": "ce42f6b629beeaa00591ba73a77d3eeac4cf28ce",
|
||||
"src": "https://github.com/savq/melange-nvim"
|
||||
@@ -49,20 +53,21 @@
|
||||
"src": "https://github.com/xero/miasma.nvim"
|
||||
},
|
||||
"mini.comment": {
|
||||
"rev": "fc87ba6554f182161d9a4bab5017c575571f000f",
|
||||
"rev": "3aa39b795c6dc54dbeaf2863aa91215850c4c8e0",
|
||||
"src": "https://github.com/nvim-mini/mini.comment"
|
||||
},
|
||||
"mini.icons": {
|
||||
"rev": "ac38c983aed0a2bd32a65ca3e2348e12e58ca292",
|
||||
"rev": "eab3e692d796d78ea6ffc978d8a380ff26fcf4e3",
|
||||
"src": "https://github.com/nvim-mini/mini.icons"
|
||||
},
|
||||
"mini.surround": {
|
||||
"rev": "d401c3856585473693e5ce9ec4c8e5b608b4c0fe",
|
||||
"rev": "5357f00aca51a3b43e7775901b1ad9699f8c2678",
|
||||
"src": "https://github.com/nvim-mini/mini.surround"
|
||||
},
|
||||
"multicursor.nvim": {
|
||||
"rev": "704b99f10a72cc05d370cfeb294ff83412a8ab55",
|
||||
"src": "https://github.com/jake-stewart/multicursor.nvim"
|
||||
"rev": "0b14690211dc5a35cdda343c2ebfc7815bf23373",
|
||||
"src": "https://github.com/jake-stewart/multicursor.nvim",
|
||||
"version": "'native'"
|
||||
},
|
||||
"neogen": {
|
||||
"rev": "23e7e9f883d01289ebd90e98025acc860ea26366",
|
||||
@@ -73,20 +78,20 @@
|
||||
"src": "https://github.com/rose-pine/neovim"
|
||||
},
|
||||
"nvim-lspconfig": {
|
||||
"rev": "a683e0ddf0cf64c6cd689e18ffb480ade3c162b7",
|
||||
"rev": "d8d2fda7aae57030452ce8cd6e770b1eb704514e",
|
||||
"src": "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
"nvim-metals": {
|
||||
"rev": "4cc98f07ec96bb748a8796831767538e0e4f9be4",
|
||||
"rev": "a4b20656bf1014404dd63bf9fd5f22fcc50fee52",
|
||||
"src": "https://github.com/scalameta/nvim-metals"
|
||||
},
|
||||
"nvim-treesitter": {
|
||||
"rev": "4916d6592ede8c07973490d9322f187e07dfefac",
|
||||
"rev": "a9c4e1457e2e59f1b82c8f78dcdb3b2517555200",
|
||||
"src": "https://github.com/nvim-treesitter/nvim-treesitter",
|
||||
"version": "'main'"
|
||||
},
|
||||
"oil.nvim": {
|
||||
"rev": "b73018b75affd13fa38e2fc94ef753b465f770d7",
|
||||
"rev": "d3733d933833a0e59b813ecec99341527adf0c28",
|
||||
"src": "https://github.com/stevearc/oil.nvim"
|
||||
},
|
||||
"plenary.nvim": {
|
||||
@@ -102,7 +107,7 @@
|
||||
"src": "https://github.com/nvim-telescope/telescope-fzf-native.nvim"
|
||||
},
|
||||
"telescope.nvim": {
|
||||
"rev": "9377230aa5305d9e9aca4ed8dadf1070fb4aa9fc",
|
||||
"rev": "40aedd8a68c78a656a10a8d62d80c54af59420fb",
|
||||
"src": "https://github.com/nvim-lua/telescope.nvim"
|
||||
},
|
||||
"torchlight.nvim": {
|
||||
|
||||
Reference in New Issue
Block a user