You've already forked dotfiles
feat: Adding a bunch of changes to move further towards a clean and more
builtin setup rather than relying upon plugins.
This commit is contained in:
@@ -1,78 +1,69 @@
|
||||
return {
|
||||
'mfussenegger/nvim-dap',
|
||||
dependencies = {
|
||||
{ 'jay-babu/mason-nvim-dap.nvim' },
|
||||
{ 'nvim-neotest/nvim-nio' },
|
||||
vim.pack.add({
|
||||
'https://github.com/rcarriga/nvim-dap-ui',
|
||||
'https://github.com/mfussenegger/nvim-dap',
|
||||
'https://github.com/nvim-neotest/nvim-nio',
|
||||
'https://github.com/theHamsta/nvim-dap-virtual-text',
|
||||
})
|
||||
|
||||
require('dapui').setup({
|
||||
mappings = {
|
||||
open = 'o',
|
||||
remove = 'd',
|
||||
edit = 'e',
|
||||
repl = 'r',
|
||||
toggle = 't',
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
'rcarriga/nvim-dap-ui',
|
||||
config = function()
|
||||
require('dapui').setup({
|
||||
mappings = {
|
||||
open = 'o',
|
||||
remove = 'd',
|
||||
edit = 'e',
|
||||
repl = 'r',
|
||||
toggle = 't',
|
||||
},
|
||||
layouts = {
|
||||
{
|
||||
elements = {
|
||||
'scopes',
|
||||
'breakpoints',
|
||||
'stacks',
|
||||
},
|
||||
size = 0.33,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
elements = {
|
||||
'console',
|
||||
'watches',
|
||||
},
|
||||
size = 0.2,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
floating = {
|
||||
max_height = nil,
|
||||
max_width = nil,
|
||||
border = 'single',
|
||||
mappings = {
|
||||
close = { 'q', '<Esc>' },
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
indent = 1
|
||||
},
|
||||
render = {
|
||||
max_type_length = nil,
|
||||
},
|
||||
})
|
||||
end,
|
||||
elements = {
|
||||
'scopes',
|
||||
'breakpoints',
|
||||
'stacks',
|
||||
},
|
||||
size = 0.33,
|
||||
position = 'right',
|
||||
},
|
||||
{
|
||||
'theHamsta/nvim-dap-virtual-text',
|
||||
config = function()
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
end,
|
||||
elements = {
|
||||
'console',
|
||||
'watches',
|
||||
},
|
||||
size = 0.2,
|
||||
position = 'bottom',
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
local mason_dap = require('mason-nvim-dap')
|
||||
floating = {
|
||||
max_height = nil,
|
||||
max_width = nil,
|
||||
border = 'single',
|
||||
mappings = {
|
||||
close = { 'q', '<Esc>' },
|
||||
},
|
||||
},
|
||||
windows = {
|
||||
indent = 1
|
||||
},
|
||||
render = {
|
||||
max_type_length = nil,
|
||||
},
|
||||
})
|
||||
|
||||
require('nvim-dap-virtual-text').setup()
|
||||
-- local mason_dap = require('mason-nvim-dap')
|
||||
local dap, dapui = require('dap'), require('dapui')
|
||||
|
||||
mason_dap.setup({
|
||||
ensure_installed = {
|
||||
'codelldb',
|
||||
'debugpy',
|
||||
},
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
function(config)
|
||||
require('mason-nvim-dap').default_setup(config)
|
||||
end,
|
||||
}
|
||||
})
|
||||
-- mason_dap.setup({
|
||||
-- ensure_installed = {
|
||||
-- 'codelldb',
|
||||
-- 'debugpy',
|
||||
-- },
|
||||
-- automatic_installation = true,
|
||||
-- handlers = {
|
||||
-- function(config)
|
||||
-- require('mason-nvim-dap').default_setup(config)
|
||||
-- end,
|
||||
-- }
|
||||
-- })
|
||||
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
@@ -136,53 +127,15 @@ return {
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{
|
||||
'<leader>b',
|
||||
function() require('dap').toggle_breakpoint() end,
|
||||
desc = 'DAP: Toggle Breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>B',
|
||||
function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end,
|
||||
desc = 'DAP: Set conditional breakpoint',
|
||||
},
|
||||
{
|
||||
'<leader>dh',
|
||||
function() require('dap.ui.widgets').hover() end,
|
||||
mode = { 'n', 'v' },
|
||||
desc = 'DAP: Debug hover',
|
||||
},
|
||||
{
|
||||
'<F5>',
|
||||
function() require('dap').continue() end,
|
||||
desc = 'DAP: Continue',
|
||||
},
|
||||
{
|
||||
'<F6>',
|
||||
function() require('dap').run_to_cursor() end,
|
||||
desc = 'DAP: Run to cursor',
|
||||
},
|
||||
{
|
||||
'<F8>',
|
||||
function() require('dap').terminate() end,
|
||||
desc = 'DAP: Terminate debug session',
|
||||
},
|
||||
{
|
||||
'<F10>',
|
||||
function() require('dap').step_over() end,
|
||||
desc = 'DAP: Step Over',
|
||||
},
|
||||
{
|
||||
'<F11>',
|
||||
function() require('dap').step_into() end,
|
||||
desc = 'DAP: Step Into',
|
||||
},
|
||||
{
|
||||
'<F12>',
|
||||
function() require('dap').step_out() end,
|
||||
desc = 'DAP: Step Out',
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
vim.keymap.set('n', '<leader>b', function ()
|
||||
require('dap').toggle_breakpoint()
|
||||
end)
|
||||
vim.keymap.set('n', '<leader>B', function() require('dap').set_breakpoint(vim.fn.input('Breakpoint condition: ')) end)
|
||||
vim.keymap.set({'n', 'v'}, '<leader>dh', function() require('dap.ui.widgets').hover() end)
|
||||
vim.keymap.set('n', '<F5>', function() require('dap').continue() end)
|
||||
vim.keymap.set('n', '<F6>', function() require('dap').run_to_cursor() end)
|
||||
vim.keymap.set('n', '<F8>', function() require('dap').terminate() end)
|
||||
vim.keymap.set('n', '<F10>', function() require('dap').step_over() end)
|
||||
vim.keymap.set('n', '<F11>', function() require('dap').step_into() end)
|
||||
vim.keymap.set('n', '<F12>', function() require('dap').step_out() end)
|
||||
|
||||
@@ -31,19 +31,19 @@ require('gitsigns').setup {
|
||||
end)
|
||||
|
||||
-- Actions
|
||||
map('n', '<leader>gs', gitsigns.stage_hunk)
|
||||
map('n', '<leader>gs', gitsigns.stage_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gu', gitsigns.undo_stage_hunk)
|
||||
map('n', '<leader>gr', gitsigns.reset_hunk)
|
||||
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('n', '<leader>gr', gitsigns.reset_hunk) -- TODO: Overlaps with LSP keymappings
|
||||
map('v', '<leader>gs', function() gitsigns.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
map('v', '<leader>gu', function() gitsigns.undo_stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
|
||||
map('v', '<leader>gr', function() gitsigns.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gS', gitsigns.stage_buffer)
|
||||
map('n', '<leader>gR', gitsigns.reset_buffer)
|
||||
map('n', '<leader>gp', gitsigns.preview_hunk)
|
||||
map('n', '<leader>gb', function() gitsigns.blame_line { full = true } end)
|
||||
map('n', '<leader>gtb', gitsigns.toggle_current_line_blame)
|
||||
map('n', '<leader>gd', gitsigns.diffthis)
|
||||
map('n', '<leader>gD', function() gitsigns.diffthis('~') end)
|
||||
map('n', '<leader>gd', gitsigns.diffthis) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gD', function() gitsigns.diffthis('~') end) -- TODO: Overlaps with LSP keymappings
|
||||
map('n', '<leader>gtd', gitsigns.toggle_deleted)
|
||||
|
||||
-- Text object
|
||||
|
||||
8
nvim/lua/plugins/gruvbox.lua
Normal file
8
nvim/lua/plugins/gruvbox.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/sainnhe/gruvbox-material',
|
||||
})
|
||||
|
||||
vim.g.gruvbox_material_enable_italic = true
|
||||
vim.g.gruvbox_material_background = 'hard'
|
||||
vim.g.gruvbox_material_better_performance = 1
|
||||
vim.cmd.colorscheme('gruvbox-material')
|
||||
78
nvim/lua/plugins/language_support.lua
Normal file
78
nvim/lua/plugins/language_support.lua
Normal file
@@ -0,0 +1,78 @@
|
||||
-- Treesitter
|
||||
local rocks_path = os.getenv('HOME') .. "/.luarocks/lib/luarocks/rocks-5.1"
|
||||
|
||||
-- Pick up the installed
|
||||
for _, parser_dir in ipairs(vim.fn.glob(rocks_path .. '/tree-sitter-*/*/', true, true)) do
|
||||
vim.opt.runtimepath:prepend(parser_dir)
|
||||
end
|
||||
|
||||
-- Start treesitter parsing on the current buffer
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
callback = function(ev)
|
||||
-- Use pcall to prevent blocking errors
|
||||
pcall(vim.treesitter.start, ev.buf)
|
||||
end
|
||||
})
|
||||
|
||||
vim.diagnostic.config({
|
||||
underline = true,
|
||||
virtual_text = {
|
||||
prefix = "●",
|
||||
source = 'always',
|
||||
},
|
||||
severity_sort = true,
|
||||
float = {
|
||||
source = 'always'
|
||||
}
|
||||
})
|
||||
|
||||
-- LSP
|
||||
-- TODO: test out removing the lspconfig plugin and using the built-in enablement
|
||||
vim.pack.add({
|
||||
'https://github.com/neovim/nvim-lspconfig',
|
||||
})
|
||||
|
||||
-- Auto set keymaps and other settings on LSP attach
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('my.lsp', {}),
|
||||
callback = function(args)
|
||||
-- Native completion
|
||||
-- local client = assert(vim.lsp.get_client_by_id(args.data.client_id))
|
||||
-- local chars = {}; for i = 32, 126 do table.insert(chars, string.char(i)) end
|
||||
-- client.server_capabilities.completionProvider.triggerCharacters = chars
|
||||
--
|
||||
-- vim.lsp.completion.enable(true, args.data.client_id, args.buf, {
|
||||
-- autotrigger = true,
|
||||
-- convert = function(item)
|
||||
-- local abbr = item.label
|
||||
-- abbr = abbr:gsub("%b()", ""):gsub("%b{}", "")
|
||||
-- abbr = abbr:match("[%w_.]+.*") or abbr
|
||||
-- abbr = #abbr > 20 and abbr:sub(1, 19) .. "..." or abbr
|
||||
--
|
||||
-- return { abbr = abbr }
|
||||
-- end,
|
||||
-- })
|
||||
|
||||
-- Keyboard Mappings
|
||||
local bufnr = args.buf
|
||||
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', '<C-[>', vim.diagnostic.goto_prev, bufopts)
|
||||
vim.keymap.set('n', '<C-]>', vim.diagnostic.goto_next, bufopts)
|
||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<leader>for', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
vim.keymap.set('n', '<leader>r', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('i', '<c-space>', vim.lsp.completion.get, bufopts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Enable LSP engines
|
||||
-- vim.lsp.enable('clangd')
|
||||
vim.lsp.enable('gdscript')
|
||||
@@ -21,7 +21,7 @@ cmp.setup {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-j>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-k>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-space>'] = cmp.mapping.complete(),
|
||||
['<C-space>'] = cmp.mapping.complete(), -- TODO: Overlaps with completion(? possibly doesn't due to state)
|
||||
['<C-y>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
|
||||
@@ -1,55 +0,0 @@
|
||||
vim.pack.add({
|
||||
'https://github.com/nvim-treesitter/nvim-treesitter'
|
||||
})
|
||||
|
||||
-- require('nvim-treesitter.configs').setup {
|
||||
-- auto_install = true,
|
||||
-- ensure_installed = {
|
||||
-- 'c',
|
||||
-- 'c_sharp',
|
||||
-- 'comment',
|
||||
-- 'css',
|
||||
-- 'gdscript',
|
||||
-- 'gitignore',
|
||||
-- 'html',
|
||||
-- 'java',
|
||||
-- 'javascript',
|
||||
-- 'json',
|
||||
-- 'lua',
|
||||
-- 'markdown',
|
||||
-- 'markdown_inline',
|
||||
-- 'python',
|
||||
-- 'query',
|
||||
-- 'rust',
|
||||
-- 'sql',
|
||||
-- 'tera',
|
||||
-- 'toml',
|
||||
-- 'tsx',
|
||||
-- 'typescript',
|
||||
-- 'yaml',
|
||||
-- },
|
||||
-- highlight = {
|
||||
-- enable = true,
|
||||
-- additional_vim_regex_highlighting = false,
|
||||
-- },
|
||||
-- incremental_selection = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- indent = {
|
||||
-- enable = true,
|
||||
-- },
|
||||
-- rainbow = {
|
||||
-- enable = true,
|
||||
-- }
|
||||
-- }
|
||||
|
||||
vim.treesitter.language.register('markdown', 'telekasten')
|
||||
|
||||
-- return {
|
||||
-- 'nvim-treesitter/nvim-treesitter',
|
||||
-- build = function()
|
||||
-- require('nvim-treesitter.install').update({ with_sync = true })
|
||||
-- end,
|
||||
-- config = function()
|
||||
-- end,
|
||||
-- }
|
||||
@@ -1,3 +1,4 @@
|
||||
-- Focus plugin that 'dims' lines around the current block/line
|
||||
vim.pack.add({
|
||||
'https://github.com/folke/twilight.nvim'
|
||||
})
|
||||
@@ -16,4 +17,4 @@ require('twilight').setup({
|
||||
}
|
||||
})
|
||||
|
||||
vim.keymap.set('n', '<leader>f', ':Twilight<CR>')
|
||||
vim.keymap.set('n', '<leader>foc', ':Twilight<CR>')
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
return {
|
||||
'mosheavni/yaml-companion.nvim',
|
||||
config = function(_, opts)
|
||||
local cfg = require('yaml-companion').setup(opts)
|
||||
vim.lsp.config('yamlls', cfg)
|
||||
vim.lsp.enable('yamlls')
|
||||
end,
|
||||
}
|
||||
vim.pack.add({
|
||||
'https://github.com/mosheavni/yaml-companion.nvim'
|
||||
})
|
||||
|
||||
local cfg = require('yaml-companion').setup()
|
||||
vim.lsp.config('yamlls', cfg)
|
||||
vim.lsp.enable('yamlls')
|
||||
|
||||
Reference in New Issue
Block a user