ascension (re enable primary c+p, treesitter textobjects
This commit is contained in:
1 parent
96c139a62e
commit
84782e1599
11 files changed
+126
-58
No files matched your search
@@ -4,4 +4,5 @@ for _, name in ipairs({
|
|||||||
"mappings",
|
"mappings",
|
||||||
"plugins",
|
"plugins",
|
||||||
"theme",
|
"theme",
|
||||||
|
"filetype",
|
||||||
}) do require("config." .. name) end
|
}) do require("config." .. name) end
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
wgsl = 'wgsl',
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -11,6 +11,7 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
end
|
end
|
||||||
|
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require('telescope.builtin')
|
||||||
|
local dap = require('dap')
|
||||||
|
|
||||||
map("gd", builtin.lsp_definitions)
|
map("gd", builtin.lsp_definitions)
|
||||||
map("gr", builtin.lsp_references)
|
map("gr", builtin.lsp_references)
|
||||||
@@ -28,9 +29,12 @@ vim.api.nvim_create_autocmd('LspAttach', {
|
|||||||
end)
|
end)
|
||||||
map("<leader>D", vim.lsp.buf.type_definition)
|
map("<leader>D", vim.lsp.buf.type_definition)
|
||||||
map("<leader>rn", vim.lsp.buf.rename)
|
map("<leader>rn", vim.lsp.buf.rename)
|
||||||
map("<leader>ca", vim.lsp.buf.code_action)
|
map("<leader>a", vim.lsp.buf.code_action)
|
||||||
map("<leader>fm", function()
|
map("<leader>fm", function()
|
||||||
vim.lsp.buf.format { async = true }
|
vim.lsp.buf.format { async = true }
|
||||||
end)
|
end)
|
||||||
|
map("<leader>da", dap.toggle_breakpoint)
|
||||||
|
map("<leader>dc", dap.continue)
|
||||||
|
map("<leader>ds", dap.step_into)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@@ -8,10 +8,6 @@ local l = "o"
|
|||||||
|
|
||||||
local m = u.mapping
|
local m = u.mapping
|
||||||
|
|
||||||
-- terminal copy paste
|
|
||||||
m.map("v", "<C-c>", '"+y')
|
|
||||||
m.map("i", "<C-v>", '<esc>"+p`]a')
|
|
||||||
|
|
||||||
-- terminal
|
-- terminal
|
||||||
m.map("t", "<esc>", "<C-\\><C-n>")
|
m.map("t", "<esc>", "<C-\\><C-n>")
|
||||||
m.map("t", "<tab>", "<tab>")
|
m.map("t", "<tab>", "<tab>")
|
||||||
|
|||||||
@@ -11,4 +11,5 @@ for _, mod in ipairs({
|
|||||||
"utils",
|
"utils",
|
||||||
"theme",
|
"theme",
|
||||||
"lsp-settings",
|
"lsp-settings",
|
||||||
|
"filetype",
|
||||||
}) do u.mod_post_write(g, "config." .. mod, u.reload) end
|
}) do u.mod_post_write(g, "config." .. mod, u.reload) end
|
||||||
@@ -4,11 +4,13 @@ local g = vim.g
|
|||||||
-- basic stuff
|
-- basic stuff
|
||||||
o.number = true
|
o.number = true
|
||||||
o.showmode = false
|
o.showmode = false
|
||||||
|
o.clipboard = "unnamedplus"
|
||||||
|
|
||||||
g.mapleader = " "
|
g.mapleader = " "
|
||||||
g.maplocalleader = ","
|
g.maplocalleader = ","
|
||||||
vim.cmd("filetype plugin on")
|
vim.cmd("filetype plugin on")
|
||||||
vim.cmd("syntax on")
|
vim.cmd("syntax on")
|
||||||
|
o.guifont = "Comic\\ Code\\ Ligatures"
|
||||||
|
|
||||||
-- line break (wrapping) settings
|
-- line break (wrapping) settings
|
||||||
o.linebreak = true
|
o.linebreak = true
|
||||||
@@ -40,3 +42,8 @@ end
|
|||||||
vim.diagnostic.config({
|
vim.diagnostic.config({
|
||||||
virtual_text = { prefix = "●" },
|
virtual_text = { prefix = "●" },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- neovide
|
||||||
|
if vim.g.neovide then
|
||||||
|
|
||||||
|
end
|
||||||
+9
-16
@@ -9,22 +9,15 @@ end
|
|||||||
hl("ExtraWhitespace", { ctermbg = "red", bg = "#ff8888" })
|
hl("ExtraWhitespace", { ctermbg = "red", bg = "#ff8888" })
|
||||||
vim.cmd [[match ExtraWhitespace /\s\+$/]]
|
vim.cmd [[match ExtraWhitespace /\s\+$/]]
|
||||||
|
|
||||||
local bg = "#201918"
|
-- make background partially transparent
|
||||||
|
|
||||||
|
-- local bg = "#1e1e2e"
|
||||||
|
-- local bg2 = "#181825"
|
||||||
|
|
||||||
-- make background transparent
|
|
||||||
-- gbhl("Normal", "none")
|
-- gbhl("Normal", "none")
|
||||||
-- gbhl("EndOfBuffer", "none")
|
-- gbhl("NormalNC", "none")
|
||||||
-- gbhl("SignColumn", "none")
|
-- gbhl("MsgArea", bg)
|
||||||
-- gbhl("NeoTreeEndOfBuffer", "none")
|
-- gbhl("NeoTreeNormal", bg)
|
||||||
|
-- gbhl("NeoTreeNormalNC", bg)
|
||||||
|
-- hl("VertSplit", { bg = bg2, fg = bg2 })
|
||||||
|
|
||||||
--[=[
|
|
||||||
for _, name in ipairs({
|
|
||||||
"NeoTreeNormal",
|
|
||||||
"NeoTreeNormalNC",
|
|
||||||
"MsgArea",
|
|
||||||
"lualine_a_command",
|
|
||||||
"lualine_a_inactive",
|
|
||||||
"lualine_b_inactive",
|
|
||||||
"lualine_c_inactive",
|
|
||||||
}) do gbhl(name, bg) end
|
|
||||||
]=]--
|
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
local rt_config = function()
|
||||||
|
local rt = require "rust-tools"
|
||||||
|
rt.setup {
|
||||||
|
server = {
|
||||||
|
-- on_attach = function(_, bufnr)
|
||||||
|
-- vim.keymap.set("n", "<C-k>", rt.hover_actions.hover_actions, { buffer = bufnr })
|
||||||
|
-- vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||||
|
-- end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
return {
|
||||||
|
{
|
||||||
|
"simrat39/rust-tools.nvim",
|
||||||
|
dependencies = {
|
||||||
|
"nvim-lua/plenary.nvim",
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
},
|
||||||
|
config = rt_config
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"windwp/nvim-autopairs",
|
||||||
|
config = function() require "nvim-autopairs".setup {} end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"scalameta/nvim-metals",
|
||||||
|
dependencies = { "nvim-lua/plenary.nvim" }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"numToStr/Comment.nvim",
|
||||||
|
config = function() require "Comment".setup {} end
|
||||||
|
},
|
||||||
|
"mfussenegger/nvim-jdtls",
|
||||||
|
"mfussenegger/nvim-dap",
|
||||||
|
"folke/neodev.nvim",
|
||||||
|
}
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
return {
|
|
||||||
{
|
|
||||||
"simrat39/rust-tools.nvim",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"mfussenegger/nvim-dap",
|
|
||||||
},
|
|
||||||
config = function() require "rust-tools".setup {} end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"windwp/nvim-autopairs",
|
|
||||||
config = function() require "nvim-autopairs".setup {} end
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"scalameta/nvim-metals",
|
|
||||||
dependencies = { "nvim-lua/plenary.nvim" }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"numToStr/Comment.nvim",
|
|
||||||
config = function() require "Comment".setup{} end
|
|
||||||
},
|
|
||||||
"mfussenegger/nvim-jdtls",
|
|
||||||
"folke/neodev.nvim",
|
|
||||||
}
|
|
||||||
@@ -48,6 +48,7 @@ local config = function()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
c.wgsl_analyzer.setup {}
|
||||||
|
|
||||||
require 'config.lsp-settings'
|
require 'config.lsp-settings'
|
||||||
end
|
end
|
||||||
|
|||||||
+61
-13
@@ -10,14 +10,6 @@ return {
|
|||||||
require("config.theme")
|
require("config.theme")
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"norcalli/nvim-colorizer.lua",
|
|
||||||
config = function()
|
|
||||||
if vim.o.termguicolors then
|
|
||||||
require("colorizer").setup()
|
|
||||||
end
|
|
||||||
end
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"nvim-lualine/lualine.nvim",
|
"nvim-lualine/lualine.nvim",
|
||||||
dependencies = { "kyazdani42/nvim-web-devicons" },
|
dependencies = { "kyazdani42/nvim-web-devicons" },
|
||||||
@@ -29,6 +21,14 @@ return {
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"norcalli/nvim-colorizer.lua",
|
||||||
|
config = function()
|
||||||
|
if vim.o.termguicolors then
|
||||||
|
require("colorizer").setup()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"lewis6991/gitsigns.nvim",
|
"lewis6991/gitsigns.nvim",
|
||||||
config = function()
|
config = function()
|
||||||
@@ -37,6 +37,59 @@ return {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||||
|
lazy = false,
|
||||||
|
enabled = true,
|
||||||
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
|
config = function()
|
||||||
|
require("nvim-treesitter.configs").setup {
|
||||||
|
highlight = { enable = true },
|
||||||
|
textobjects = {
|
||||||
|
move = {
|
||||||
|
enable = true,
|
||||||
|
set_jumps = true, -- whether to set jumps in the jumplist
|
||||||
|
goto_next_start = {
|
||||||
|
["]f"] = "@function.outer",
|
||||||
|
["]]"] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_next_end = {
|
||||||
|
["]F"] = "@function.outer",
|
||||||
|
["]["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_start = {
|
||||||
|
["[f"] = "@function.outer",
|
||||||
|
["[["] = "@class.outer",
|
||||||
|
},
|
||||||
|
goto_previous_end = {
|
||||||
|
["[F"] = "@function.outer",
|
||||||
|
["[]"] = "@class.outer",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
select = {
|
||||||
|
enable = true,
|
||||||
|
lookahead = true,
|
||||||
|
keymaps = {
|
||||||
|
["af"] = "@function.outer",
|
||||||
|
["if"] = "@function.inner",
|
||||||
|
["ac"] = "@class.outer",
|
||||||
|
["ic"] = "@class.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
swap = {
|
||||||
|
enable = true,
|
||||||
|
swap_next = {
|
||||||
|
["<leader>so"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
swap_previous = {
|
||||||
|
["<leader>sn"] = "@parameter.inner",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = function()
|
build = function()
|
||||||
@@ -44,11 +97,6 @@ return {
|
|||||||
with_sync = true
|
with_sync = true
|
||||||
}
|
}
|
||||||
end,
|
end,
|
||||||
config = function()
|
|
||||||
require("nvim-treesitter.configs").setup {
|
|
||||||
highlight = { enable = true }
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
},
|
},
|
||||||
"elkowar/yuck.vim",
|
"elkowar/yuck.vim",
|
||||||
"kmonad/kmonad-vim"
|
"kmonad/kmonad-vim"
|
||||||
|
|||||||
Reference in new issue
Block a user