fmt(neovim): stylua
This commit is contained in:
parent
1929a53229
commit
97b2bb0d4f
11 changed files with 1190 additions and 1117 deletions
|
|
@ -1,14 +1,14 @@
|
||||||
vim.opt.background = 'dark'
|
vim.opt.background = "dark"
|
||||||
vim.g.colors_name = 'jdkaplan-cool'
|
vim.g.colors_name = "jdkaplan-cool"
|
||||||
|
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
local pkg = 'jdkaplan.cool_theme'
|
local pkg = "jdkaplan.cool_theme"
|
||||||
|
|
||||||
-- Clear the Lua cache for the theme package to force it to load every time.
|
-- Clear the Lua cache for the theme package to force it to load every time.
|
||||||
package.loaded[pkg] = nil
|
package.loaded[pkg] = nil
|
||||||
|
|
||||||
local lush = require('lush')
|
local lush = require("lush")
|
||||||
local theme = require(pkg)
|
local theme = require(pkg)
|
||||||
|
|
||||||
lush(theme)
|
lush(theme)
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
vim.opt.background = 'light'
|
vim.opt.background = "light"
|
||||||
vim.g.colors_name = 'jdkaplan-warm'
|
vim.g.colors_name = "jdkaplan-warm"
|
||||||
|
|
||||||
vim.o.termguicolors = true
|
vim.o.termguicolors = true
|
||||||
|
|
||||||
local pkg = 'jdkaplan.warm_theme'
|
local pkg = "jdkaplan.warm_theme"
|
||||||
|
|
||||||
-- Clear the Lua cache for the theme package to force it to load every time.
|
-- Clear the Lua cache for the theme package to force it to load every time.
|
||||||
package.loaded[pkg] = nil
|
package.loaded[pkg] = nil
|
||||||
|
|
||||||
local lush = require('lush')
|
local lush = require("lush")
|
||||||
local theme = require(pkg)
|
local theme = require(pkg)
|
||||||
|
|
||||||
lush(theme)
|
lush(theme)
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,13 @@
|
||||||
local bufnr = vim.api.nvim_get_current_buf()
|
local bufnr = vim.api.nvim_get_current_buf()
|
||||||
|
|
||||||
function rustLspMap(mode, keys, cmd)
|
function rustLspMap(mode, keys, cmd)
|
||||||
vim.keymap.set(
|
vim.keymap.set(mode, keys, function()
|
||||||
mode,
|
vim.cmd.RustLsp(cmd)
|
||||||
keys,
|
end, { silent = true, buffer = bufnr })
|
||||||
function() vim.cmd.RustLsp(cmd) end,
|
|
||||||
{ silent = true, buffer = bufnr }
|
|
||||||
)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Use rust-analyzer's grouping of actions
|
-- Use rust-analyzer's grouping of actions
|
||||||
rustLspMap("n", "gra", "codeAction")
|
rustLspMap("n", "gra", "codeAction")
|
||||||
|
|
||||||
-- Use rustaceanvim's hover actions
|
-- Use rustaceanvim's hover actions
|
||||||
rustLspMap("n", "K", {'hover', 'actions'})
|
rustLspMap("n", "K", { "hover", "actions" })
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
vim.o.shell = '/bin/sh'
|
vim.o.shell = "/bin/sh"
|
||||||
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim3/bin/python")
|
vim.g.python3_host_prog = vim.fn.expand("~/.virtualenvs/neovim3/bin/python")
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
|
@ -13,7 +13,7 @@ require("lazy").setup("plugins", {
|
||||||
change_detection = {
|
change_detection = {
|
||||||
-- Disable automatic reloading of config files.
|
-- Disable automatic reloading of config files.
|
||||||
enabled = false,
|
enabled = false,
|
||||||
}
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
theme = "jdkaplan-temp"
|
theme = "jdkaplan-temp"
|
||||||
|
|
@ -74,23 +74,23 @@ vim.o.secure = true
|
||||||
|
|
||||||
vim.keymap.set("", "<Space>w", "<C-w>", { remap = true })
|
vim.keymap.set("", "<Space>w", "<C-w>", { remap = true })
|
||||||
vim.keymap.set("", '<Space>w"', ":split<CR>")
|
vim.keymap.set("", '<Space>w"', ":split<CR>")
|
||||||
vim.keymap.set("", '<Space>w%', ":vsplit<CR>")
|
vim.keymap.set("", "<Space>w%", ":vsplit<CR>")
|
||||||
|
|
||||||
vim.keymap.set("", '<Leader>w', ":w<CR>")
|
vim.keymap.set("", "<Leader>w", ":w<CR>")
|
||||||
|
|
||||||
vim.keymap.set("n", "<C-w>]", function()
|
vim.keymap.set("n", "<C-w>]", function()
|
||||||
if vim.api.nvim_win_get_width(0) > 2 * 80 then
|
if vim.api.nvim_win_get_width(0) > 2 * 80 then
|
||||||
vim.cmd('vertical wincmd ]')
|
vim.cmd("vertical wincmd ]")
|
||||||
else
|
else
|
||||||
vim.cmd('horizontal wincmd ]')
|
vim.cmd("horizontal wincmd ]")
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
-- TODO: Delete these ; fake-leader bindings
|
-- TODO: Delete these ; fake-leader bindings
|
||||||
vim.keymap.set("", ';w', ":w<CR>")
|
vim.keymap.set("", ";w", ":w<CR>")
|
||||||
|
|
||||||
-- TODO: Delete these ; fake-leader bindings
|
-- TODO: Delete these ; fake-leader bindings
|
||||||
vim.keymap.set("", ';;', ";")
|
vim.keymap.set("", ";;", ";")
|
||||||
|
|
||||||
vim.keymap.set("", "<Space><Space>", ":nohlsearch<CR>")
|
vim.keymap.set("", "<Space><Space>", ":nohlsearch<CR>")
|
||||||
|
|
||||||
|
|
@ -145,10 +145,18 @@ function auto_correct(mode, old, new, scale, limit, cmd)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
auto_correct("n", ';"', '<C-w>s', 100, 1000, vim.cmd.split)
|
auto_correct("n", ';"', "<C-w>s", 100, 1000, vim.cmd.split)
|
||||||
auto_correct("n", ';%', '<C-w>v', 100, 1000, vim.cmd.vsplit)
|
auto_correct("n", ";%", "<C-w>v", 100, 1000, vim.cmd.vsplit)
|
||||||
auto_correct("n", ';0', '<C-w>c', 100, 1000, vim.cmd.close)
|
auto_correct("n", ";0", "<C-w>c", 100, 1000, vim.cmd.close)
|
||||||
auto_correct("n", ";h", "<C-w>h", 10, 500, function() vim.cmd.wincmd("h") end)
|
auto_correct("n", ";h", "<C-w>h", 10, 500, function()
|
||||||
auto_correct("n", ";j", "<C-w>j", 10, 500, function() vim.cmd.wincmd("j") end)
|
vim.cmd.wincmd("h")
|
||||||
auto_correct("n", ";k", "<C-w>k", 10, 500, function() vim.cmd.wincmd("k") end)
|
end)
|
||||||
auto_correct("n", ";l", "<C-w>l", 10, 500, function() vim.cmd.wincmd("l") end)
|
auto_correct("n", ";j", "<C-w>j", 10, 500, function()
|
||||||
|
vim.cmd.wincmd("j")
|
||||||
|
end)
|
||||||
|
auto_correct("n", ";k", "<C-w>k", 10, 500, function()
|
||||||
|
vim.cmd.wincmd("k")
|
||||||
|
end)
|
||||||
|
auto_correct("n", ";l", "<C-w>l", 10, 500, function()
|
||||||
|
vim.cmd.wincmd("l")
|
||||||
|
end)
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,9 @@
|
||||||
"gitsigns.nvim": { "branch": "main", "commit": "220446c8c86a280180d852efac60991eaf1a21d4" },
|
"gitsigns.nvim": { "branch": "main", "commit": "220446c8c86a280180d852efac60991eaf1a21d4" },
|
||||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||||
"keytrail.nvim": { "branch": "main", "commit": "153a76d5891065a328be82316b6813662904da71" },
|
"keytrail.nvim": { "branch": "main", "commit": "153a76d5891065a328be82316b6813662904da71" },
|
||||||
"lazy.nvim": { "branch": "main", "commit": "1ea3c4085785f460fb0e46d2fe1ee895f5f9e7c1" },
|
"lazy.nvim": { "branch": "main", "commit": "ed4dc336a73c18da6fea6e1cf7ad6e1b76d281eb" },
|
||||||
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
|
"lush.nvim": { "branch": "main", "commit": "9c60ec2279d62487d942ce095e49006af28eed6e" },
|
||||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "2304ff65ecc8cb2afc2484de3e2ed9a407edf0b9" },
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "1d77bd86e1c3eaa777010c95dad455b83823f247" },
|
||||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||||
"nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" },
|
"nerdtree": { "branch": "master", "commit": "690d061b591525890f1471c6675bcb5bdc8cdff9" },
|
||||||
"none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" },
|
"none-ls.nvim": { "branch": "main", "commit": "a96172f673f720cd4f3572e1fcd08400ed3eb25d" },
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
"nvim-cmp": { "branch": "main", "commit": "a7bcf1d88069fc67c9ace8a62ba480b8fe879025" },
|
||||||
"nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" },
|
"nvim-coverage": { "branch": "main", "commit": "a939e425e363319d952a6c35fb3f38b34041ded2" },
|
||||||
"nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" },
|
"nvim-dap": { "branch": "master", "commit": "6782b097af2417a4c3e33849b0a26ae2188bd7ea" },
|
||||||
"nvim-lspconfig": { "branch": "master", "commit": "52a893217b2c12e215c6851bd8813b43204416cd" },
|
"nvim-lspconfig": { "branch": "master", "commit": "a9b2fb560c4ab22c10728fd5149dbd7b62aa4f69" },
|
||||||
"nvim-surround": { "branch": "main", "commit": "0cadeb0f1930e6b25cf65395f8269bfcc36b6791" },
|
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
|
||||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "a9742cbc1f95db9eaf3293bf8cd0622ca36542bb" },
|
"nvim-treesitter-textobjects": { "branch": "master", "commit": "a9742cbc1f95db9eaf3293bf8cd0622ca36542bb" },
|
||||||
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
"nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" },
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local lush = require('lush')
|
local lush = require("lush")
|
||||||
local hsl = lush.hsl
|
local hsl = lush.hsl
|
||||||
|
|
||||||
local theme = lush(function(injected_functions)
|
local theme = lush(function(injected_functions)
|
||||||
|
|
@ -6,6 +6,7 @@ local theme = lush(function(injected_functions)
|
||||||
-- https://github.com/rktjmp/lush.nvim/issues/109
|
-- https://github.com/rktjmp/lush.nvim/issues/109
|
||||||
local sym = injected_functions.sym
|
local sym = injected_functions.sym
|
||||||
|
|
||||||
|
-- stylua: ignore
|
||||||
return {
|
return {
|
||||||
ColorColumn { bg = '#5F0000' }, -- Columns set with 'colorcolumn'
|
ColorColumn { bg = '#5F0000' }, -- Columns set with 'colorcolumn'
|
||||||
Conceal {}, -- Placeholder characters substituted for concealed text (see 'conceallevel')
|
Conceal {}, -- Placeholder characters substituted for concealed text (see 'conceallevel')
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
local lush = require('lush')
|
local lush = require("lush")
|
||||||
local hsl = lush.hsl
|
local hsl = lush.hsl
|
||||||
|
|
||||||
local theme = lush(function(injected_functions)
|
local theme = lush(function(injected_functions)
|
||||||
|
|
@ -6,6 +6,7 @@ local theme = lush(function(injected_functions)
|
||||||
-- https://github.com/rktjmp/lush.nvim/issues/109
|
-- https://github.com/rktjmp/lush.nvim/issues/109
|
||||||
local sym = injected_functions.sym
|
local sym = injected_functions.sym
|
||||||
|
|
||||||
|
-- stylua: ignore
|
||||||
return {
|
return {
|
||||||
ColorColumn { bg = '#5F0000' }, -- Columns set with 'colorcolumn'
|
ColorColumn { bg = '#5F0000' }, -- Columns set with 'colorcolumn'
|
||||||
Conceal {}, -- Placeholder characters substituted for concealed text (see 'conceallevel')
|
Conceal {}, -- Placeholder characters substituted for concealed text (see 'conceallevel')
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
return {
|
return {
|
||||||
-- Theme
|
-- Theme
|
||||||
'rktjmp/lush.nvim',
|
"rktjmp/lush.nvim",
|
||||||
|
|
||||||
-- tpope extended universe
|
-- tpope extended universe
|
||||||
"tpope/vim-abolish",
|
"tpope/vim-abolish",
|
||||||
|
|
@ -74,8 +74,8 @@ return {
|
||||||
enable_cursorcross = false,
|
enable_cursorcross = false,
|
||||||
disable_cursorcross = false,
|
disable_cursorcross = false,
|
||||||
toggle_cursorcross = false,
|
toggle_cursorcross = false,
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
-- etc.
|
-- etc.
|
||||||
|
|
@ -85,8 +85,8 @@ return {
|
||||||
"almo7aya/openingh.nvim",
|
"almo7aya/openingh.nvim",
|
||||||
url = "https://github.com/jdkaplan/openingh.nvim",
|
url = "https://github.com/jdkaplan/openingh.nvim",
|
||||||
keys = {
|
keys = {
|
||||||
{ "<Leader>gh", "V:OpenInGHFile<CR>", mode = {"n"} },
|
{ "<Leader>gh", "V:OpenInGHFile<CR>", mode = { "n" } },
|
||||||
{ "<Leader>gh", ":OpenInGHFile<CR>", mode = {"v"} },
|
{ "<Leader>gh", ":OpenInGHFile<CR>", mode = { "v" } },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -100,10 +100,10 @@ return {
|
||||||
"ntpeters/vim-better-whitespace",
|
"ntpeters/vim-better-whitespace",
|
||||||
init = function()
|
init = function()
|
||||||
vim.g.better_whitespace_enabled = 1
|
vim.g.better_whitespace_enabled = 1
|
||||||
vim.g.better_whitespace_filetypes_blacklist = { 'diff', 'zig' }
|
vim.g.better_whitespace_filetypes_blacklist = { "diff", "zig" }
|
||||||
vim.g.strip_whitespace_on_save = 1
|
vim.g.strip_whitespace_on_save = 1
|
||||||
vim.g.strip_whitespace_confirm = 0
|
vim.g.strip_whitespace_confirm = 0
|
||||||
vim.g.better_whitespace_operator = ''
|
vim.g.better_whitespace_operator = ""
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -161,5 +161,5 @@ return {
|
||||||
desc = "Buffer Local Keymaps (which-key)",
|
desc = "Buffer Local Keymaps (which-key)",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,20 @@
|
||||||
vim.lsp.inlay_hint.enable(true)
|
vim.lsp.inlay_hint.enable(true)
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('LspAttach', {
|
vim.api.nvim_create_autocmd("LspAttach", {
|
||||||
group = vim.api.nvim_create_augroup('jdkaplan.lsp', {}),
|
group = vim.api.nvim_create_augroup("jdkaplan.lsp", {}),
|
||||||
callback = function(args)
|
callback = function(args)
|
||||||
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||||
|
|
||||||
if client:supports_method('textDocument/completion') then
|
if client:supports_method("textDocument/completion") then
|
||||||
vim.lsp.completion.enable(true, client.id, args.buf, {autotrigger = false})
|
vim.lsp.completion.enable(true, client.id, args.buf, { autotrigger = false })
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Usually not needed if server supports "textDocument/willSaveWaitUntil".
|
-- Usually not needed if server supports "textDocument/willSaveWaitUntil".
|
||||||
already_waits = client:supports_method('textDocument/willSaveWaitUntil')
|
already_waits = client:supports_method("textDocument/willSaveWaitUntil")
|
||||||
can_fmt = client:supports_method('textDocument/formatting')
|
can_fmt = client:supports_method("textDocument/formatting")
|
||||||
if not already_waits and can_fmt then
|
if not already_waits and can_fmt then
|
||||||
vim.api.nvim_create_autocmd('BufWritePre', {
|
vim.api.nvim_create_autocmd("BufWritePre", {
|
||||||
group = vim.api.nvim_create_augroup('jdkaplan.lsp', {clear=false}),
|
group = vim.api.nvim_create_augroup("jdkaplan.lsp", { clear = false }),
|
||||||
buffer = args.buf,
|
buffer = args.buf,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
|
vim.lsp.buf.format({ bufnr = args.buf, id = client.id, timeout_ms = 1000 })
|
||||||
|
|
@ -79,10 +79,10 @@ return {
|
||||||
signcolumn = false,
|
signcolumn = false,
|
||||||
show_deleted = false,
|
show_deleted = false,
|
||||||
current_line_blame = false,
|
current_line_blame = false,
|
||||||
current_line_blame_formatter = ' <author> <author_time:%Y-%m-%d> <summary>',
|
current_line_blame_formatter = " <author> <author_time:%Y-%m-%d> <summary>",
|
||||||
current_line_blame_opts = {
|
current_line_blame_opts = {
|
||||||
virt_text = true,
|
virt_text = true,
|
||||||
virt_text_pos = 'eol',
|
virt_text_pos = "eol",
|
||||||
delay = 0,
|
delay = 0,
|
||||||
ignore_whitespace = false,
|
ignore_whitespace = false,
|
||||||
},
|
},
|
||||||
|
|
@ -91,16 +91,36 @@ return {
|
||||||
{
|
{
|
||||||
"RRethy/vim-illuminate",
|
"RRethy/vim-illuminate",
|
||||||
init = function()
|
init = function()
|
||||||
local illuminate = require('illuminate')
|
local illuminate = require("illuminate")
|
||||||
illuminate.configure({
|
illuminate.configure({
|
||||||
delay = 500,
|
delay = 500,
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<leader>ii", function() require('illuminate').toggle_buf() end },
|
{
|
||||||
{ "<leader>in", function() require('illuminate').goto_next_reference() end },
|
"<leader>ii",
|
||||||
{ "<leader>ip", function() require('illuminate').goto_prev_reference() end },
|
function()
|
||||||
{ "<leader>if", function() require('illuminate').toggle_freeze_buf() end },
|
require("illuminate").toggle_buf()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>in",
|
||||||
|
function()
|
||||||
|
require("illuminate").goto_next_reference()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>ip",
|
||||||
|
function()
|
||||||
|
require("illuminate").goto_prev_reference()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<leader>if",
|
||||||
|
function()
|
||||||
|
require("illuminate").toggle_freeze_buf()
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -108,7 +128,7 @@ return {
|
||||||
main = "ibl",
|
main = "ibl",
|
||||||
opts = {
|
opts = {
|
||||||
indent = {
|
indent = {
|
||||||
char = '┊',
|
char = "┊",
|
||||||
},
|
},
|
||||||
scope = { enabled = false },
|
scope = { enabled = false },
|
||||||
},
|
},
|
||||||
|
|
@ -121,9 +141,9 @@ return {
|
||||||
require("coverage").setup({
|
require("coverage").setup({
|
||||||
auto_reload = true,
|
auto_reload = true,
|
||||||
signs = {
|
signs = {
|
||||||
covered = { text="▎" },
|
covered = { text = "▎" },
|
||||||
partial = { text="▌" },
|
partial = { text = "▌" },
|
||||||
uncovered = { text="█" },
|
uncovered = { text = "█" },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
@ -138,7 +158,7 @@ return {
|
||||||
url = "https://github.com/jdkaplan/keytrail.nvim",
|
url = "https://github.com/jdkaplan/keytrail.nvim",
|
||||||
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
dependencies = { "nvim-treesitter/nvim-treesitter" },
|
||||||
opts = {
|
opts = {
|
||||||
key_mapping = '<Space>j',
|
key_mapping = "<Space>j",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
@ -147,7 +167,7 @@ return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate",
|
build = ":TSUpdate",
|
||||||
init = function()
|
init = function()
|
||||||
require('nvim-treesitter.configs').setup({
|
require("nvim-treesitter.configs").setup({
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
incremental_selection = { enable = true },
|
incremental_selection = { enable = true },
|
||||||
|
|
||||||
|
|
@ -241,7 +261,7 @@ return {
|
||||||
-- Telescope
|
-- Telescope
|
||||||
{
|
{
|
||||||
"nvim-telescope/telescope.nvim",
|
"nvim-telescope/telescope.nvim",
|
||||||
version = '^0.1.0',
|
version = "^0.1.0",
|
||||||
dependencies = {
|
dependencies = {
|
||||||
"nvim-lua/plenary.nvim",
|
"nvim-lua/plenary.nvim",
|
||||||
"nvim-telescope/telescope-fzf-native.nvim",
|
"nvim-telescope/telescope-fzf-native.nvim",
|
||||||
|
|
@ -251,33 +271,33 @@ return {
|
||||||
"nvim-telescope/telescope-symbols.nvim",
|
"nvim-telescope/telescope-symbols.nvim",
|
||||||
},
|
},
|
||||||
init = function()
|
init = function()
|
||||||
local telescope = require('telescope')
|
local telescope = require("telescope")
|
||||||
telescope.load_extension('fzf')
|
telescope.load_extension("fzf")
|
||||||
telescope.load_extension('aerial')
|
telescope.load_extension("aerial")
|
||||||
telescope.load_extension('ui-select')
|
telescope.load_extension("ui-select")
|
||||||
|
|
||||||
local builtin = require('telescope.builtin')
|
local builtin = require("telescope.builtin")
|
||||||
|
|
||||||
local function find_files(opts)
|
local function find_files(opts)
|
||||||
opts = opts or {}
|
opts = opts or {}
|
||||||
opts['hidden'] = true
|
opts["hidden"] = true
|
||||||
return builtin.find_files(opts)
|
return builtin.find_files(opts)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.keymap.set('n', '<Space>f', find_files)
|
vim.keymap.set("n", "<Space>f", find_files)
|
||||||
vim.keymap.set('n', '<Space>g', builtin.live_grep)
|
vim.keymap.set("n", "<Space>g", builtin.live_grep)
|
||||||
vim.keymap.set('n', '<Space>b', builtin.buffers)
|
vim.keymap.set("n", "<Space>b", builtin.buffers)
|
||||||
vim.keymap.set('n', '<Space>*', builtin.grep_string)
|
vim.keymap.set("n", "<Space>*", builtin.grep_string)
|
||||||
vim.keymap.set('n', '<Space>o', telescope.extensions.aerial.aerial)
|
vim.keymap.set("n", "<Space>o", telescope.extensions.aerial.aerial)
|
||||||
vim.keymap.set('n', '<Space>t', builtin.builtin)
|
vim.keymap.set("n", "<Space>t", builtin.builtin)
|
||||||
|
|
||||||
-- TODO: Delete these ; fake-leader bindings
|
-- TODO: Delete these ; fake-leader bindings
|
||||||
vim.keymap.set('n', ';f', find_files)
|
vim.keymap.set("n", ";f", find_files)
|
||||||
vim.keymap.set('n', ';g', builtin.live_grep)
|
vim.keymap.set("n", ";g", builtin.live_grep)
|
||||||
vim.keymap.set('n', ';b', builtin.buffers)
|
vim.keymap.set("n", ";b", builtin.buffers)
|
||||||
vim.keymap.set('n', ';*', builtin.grep_string)
|
vim.keymap.set("n", ";*", builtin.grep_string)
|
||||||
|
|
||||||
vim.keymap.set('i', '<C-G><C-F>', builtin.symbols)
|
vim.keymap.set("i", "<C-G><C-F>", builtin.symbols)
|
||||||
end,
|
end,
|
||||||
opts = function(_plugin, _config)
|
opts = function(_plugin, _config)
|
||||||
local actions = require("telescope.actions")
|
local actions = require("telescope.actions")
|
||||||
|
|
@ -350,7 +370,7 @@ return {
|
||||||
end
|
end
|
||||||
|
|
||||||
if row and col then
|
if row and col then
|
||||||
pcall(vim.api.nvim_win_set_cursor, 0, { row, col-1 })
|
pcall(vim.api.nvim_win_set_cursor, 0, { row, col - 1 })
|
||||||
end
|
end
|
||||||
|
|
||||||
::continue::
|
::continue::
|
||||||
|
|
@ -380,7 +400,8 @@ return {
|
||||||
"--smart-case",
|
"--smart-case",
|
||||||
-- Include hidden files, but continue ignoring the .git directory itself.
|
-- Include hidden files, but continue ignoring the .git directory itself.
|
||||||
"--hidden",
|
"--hidden",
|
||||||
"--iglob", "!.git",
|
"--iglob",
|
||||||
|
"!.git",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
pickers = {},
|
pickers = {},
|
||||||
|
|
@ -420,7 +441,7 @@ return {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"mrcjkb/rustaceanvim",
|
"mrcjkb/rustaceanvim",
|
||||||
version = '^6',
|
version = "^6",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
@ -454,7 +475,7 @@ return {
|
||||||
},
|
},
|
||||||
build = "make install_jsregexp",
|
build = "make install_jsregexp",
|
||||||
init = function()
|
init = function()
|
||||||
local luasnip = require('luasnip')
|
local luasnip = require("luasnip")
|
||||||
|
|
||||||
luasnip.filetype_extend("typescript", { "javascript" })
|
luasnip.filetype_extend("typescript", { "javascript" })
|
||||||
luasnip.filetype_extend("typescriptreact", { "javascript", "react" })
|
luasnip.filetype_extend("typescriptreact", { "javascript", "react" })
|
||||||
|
|
@ -463,23 +484,25 @@ return {
|
||||||
require("luasnip.loaders.from_snipmate").lazy_load()
|
require("luasnip.loaders.from_snipmate").lazy_load()
|
||||||
require("luasnip.loaders.from_lua").lazy_load()
|
require("luasnip.loaders.from_lua").lazy_load()
|
||||||
|
|
||||||
local cmp = require('cmp')
|
local cmp = require("cmp")
|
||||||
cmp.setup {
|
cmp.setup({
|
||||||
completion = {
|
completion = {
|
||||||
autocomplete = false,
|
autocomplete = false,
|
||||||
},
|
},
|
||||||
snippet = {
|
snippet = {
|
||||||
expand = function(args) luasnip.lsp_expand(args.body) end,
|
expand = function(args)
|
||||||
|
luasnip.lsp_expand(args.body)
|
||||||
|
end,
|
||||||
},
|
},
|
||||||
mapping = cmp.mapping.preset.insert({
|
mapping = cmp.mapping.preset.insert({
|
||||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||||
['<C-Space>'] = cmp.mapping.complete(),
|
["<C-Space>"] = cmp.mapping.complete(),
|
||||||
['<CR>'] = cmp.mapping.confirm {
|
["<CR>"] = cmp.mapping.confirm({
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
behavior = cmp.ConfirmBehavior.Replace,
|
||||||
select = true,
|
select = true,
|
||||||
},
|
}),
|
||||||
['<Tab>'] = cmp.mapping(function(fallback)
|
["<Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_next_item()
|
cmp.select_next_item()
|
||||||
elseif luasnip.expand_or_jumpable() then
|
elseif luasnip.expand_or_jumpable() then
|
||||||
|
|
@ -487,8 +510,8 @@ return {
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { "i", "s" }),
|
||||||
['<S-Tab>'] = cmp.mapping(function(fallback)
|
["<S-Tab>"] = cmp.mapping(function(fallback)
|
||||||
if cmp.visible() then
|
if cmp.visible() then
|
||||||
cmp.select_prev_item()
|
cmp.select_prev_item()
|
||||||
elseif luasnip.jumpable(-1) then
|
elseif luasnip.jumpable(-1) then
|
||||||
|
|
@ -496,29 +519,69 @@ return {
|
||||||
else
|
else
|
||||||
fallback()
|
fallback()
|
||||||
end
|
end
|
||||||
end, { 'i', 's' }),
|
end, { "i", "s" }),
|
||||||
}),
|
}),
|
||||||
sources = {
|
sources = {
|
||||||
{ name = "nvim_lsp" },
|
{ name = "nvim_lsp" },
|
||||||
{ name = "luasnip" },
|
{ name = "luasnip" },
|
||||||
},
|
},
|
||||||
}
|
})
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Debugging
|
-- Debugging
|
||||||
{
|
{
|
||||||
'mfussenegger/nvim-dap',
|
"mfussenegger/nvim-dap",
|
||||||
lazy = false,
|
lazy = false,
|
||||||
keys = {
|
keys = {
|
||||||
{ "<Leader>db", function() require('dap').toggle_breakpoint() end },
|
{
|
||||||
{ "<Leader>dB", function() require('dap').set_breakpoint() end },
|
"<Leader>db",
|
||||||
{ "<Leader>dc", function() require('dap').continue() end },
|
function()
|
||||||
{ "<Leader>dn", function() require('dap').step_over() end },
|
require("dap").toggle_breakpoint()
|
||||||
{ "<Leader>dsi", function() require('dap').step_into() end },
|
end,
|
||||||
{ "<Leader>dso", function() require('dap').step_out() end },
|
},
|
||||||
{ "<Leader>dj", function() require('dap').down() end },
|
{
|
||||||
{ "<Leader>dk", function() require('dap').up() end },
|
"<Leader>dB",
|
||||||
|
function()
|
||||||
|
require("dap").set_breakpoint()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dc",
|
||||||
|
function()
|
||||||
|
require("dap").continue()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dn",
|
||||||
|
function()
|
||||||
|
require("dap").step_over()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dsi",
|
||||||
|
function()
|
||||||
|
require("dap").step_into()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dso",
|
||||||
|
function()
|
||||||
|
require("dap").step_out()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dj",
|
||||||
|
function()
|
||||||
|
require("dap").down()
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"<Leader>dk",
|
||||||
|
function()
|
||||||
|
require("dap").up()
|
||||||
|
end,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
3
neovim/stylua.toml
Normal file
3
neovim/stylua.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
indent_type = "Spaces"
|
||||||
|
indent_width = 2
|
||||||
|
call_parentheses = "Input"
|
||||||
Loading…
Add table
Add a link
Reference in a new issue