[neovim] Some tweaks

This commit is contained in:
Adam Cooper 2023-12-23 19:49:59 -05:00
parent 7153792ade
commit 8ed7eab826

View file

@ -6,7 +6,7 @@ vim.opt.clipboard = "unnamedplus,unnamed"
-- Spaces indentation
vim.opt.expandtab = true -- converts tabs to spaces
vim.opt.tabstop = 4 -- tab equals 2 spaces
vim.opt.tabstop = 4 -- tab equals 4 spaces
vim.opt.shiftwidth = 4 -- indent size in characters
-- Show whitespace (:list)
@ -23,7 +23,7 @@ vim.opt.cursorline = true
-- Enable folding
vim.opt.foldmethod = "syntax"
vim.opt.foldlevel = 0
vim.opt.foldlevel = 5
-- Enable 24-bit RGB color in the TUI
vim.opt.termguicolors = true
@ -49,7 +49,7 @@ vim.keymap.set("n", "<c-h>", "<c-w>h", { noremap = true, desc = 'Go to window to
vim.keymap.set("t", "<c-j>", "<c-\\><c-n><c-w>j", { noremap = true, desc = 'Go to window below' })
vim.keymap.set("t", "<c-k>", "<c-\\><c-n><c-w>k", { noremap = true, desc = 'Go to window above' })
vim.keymap.set("t", "<c-h>", "<c-\\><c-n><c-w>h", { noremap = true, desc = 'Go to window to the left' })
vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
-- vim.keymap.set("t", "<c-l>", "<c-\\><c-n><c-w>l", { noremap = true, desc = 'Go to window to the right' })
--[[
vim.keymap.set(
@ -128,6 +128,13 @@ require("lazy").setup({
opts = {},
config = function(_, opts) require'lsp_signature'.setup(opts) end
},
"mfussenegger/nvim-dap",
{ "mxsdev/nvim-dap-vscode-js", requires = "mfussenegger/nvim-dap" },
{
"microsoft/vscode-js-debug",
opt = true,
run = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out",
},
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"nvimdev/lspsaga.nvim",
@ -147,6 +154,7 @@ require("lazy").setup({
"hrsh7th/cmp-nvim-lsp-signature-help",
"tpope/vim-fugitive",
"lewis6991/gitsigns.nvim",
"famiu/bufdelete.nvim",
})
--[[ mason
@ -441,6 +449,47 @@ vim.keymap.set('n', '<leader>sl', '<cmd>Lspsaga outline<CR>')
vim.keymap.set('n', '<leader>rn', '<cmd>Lspsaga rename<CR>')
vim.keymap.set('n', '<leader>st', '<cmd>Lspsaga term_toggle<CR>')
-- setup adapters
require('dap-vscode-js').setup({
debugger_path = vim.fn.stdpath('data') .. '/mason/packages/js-debug-adapter',
debugger_cmd = { 'js-debug-adapter' },
adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' },
})
local dap = require('dap')
for _, language in ipairs({ "typescript", "javascript" }) do
dap.configurations[language] = {
{
type = "pwa-node",
request = "launch",
name = "Launch file",
program = "${file}",
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "attach",
name = "Attach",
processId = require'dap.utils'.pick_process,
cwd = "${workspaceFolder}",
},
{
type = "pwa-node",
request = "launch",
name = "Debug Mocha Tests",
-- trace = true, -- include debugger info
runtimeExecutable = "node",
runtimeArgs = {
"./node_modules/mocha/bin/mocha.js",
},
rootPath = "${workspaceFolder}",
cwd = "${workspaceFolder}",
console = "integratedTerminal",
internalConsoleOptions = "neverOpen",
},
}
end
-- Tweak GitSigns blame color
-- This differentiates the cursorline from the git blame text
vim.cmd("highlight GitSignsCurrentLineBlame gui=bold guifg=#339944")