chore(nvim): cleaned config a bit

This commit is contained in:
Afonso Franco 2024-03-03 16:58:37 +00:00
parent 0dc317e3b7
commit 7117f8beb0
Signed by: afonso
SSH key fingerprint: SHA256:gkVPzsQQJzqi21ntQBV6pXTx4bYI53rFGI4XtvCpwd4
8 changed files with 83 additions and 197 deletions

View file

@ -3,7 +3,7 @@ local npairs = require('nvim-autopairs')
npairs.setup({ npairs.setup({
map_cr = true, map_cr = true,
map_bs = true, map_bs = false,
check_ts = true, check_ts = true,
enable_check_bracket_line = true, enable_check_bracket_line = true,
ignored_next_char = "[%w]" ignored_next_char = "[%w]"

View file

@ -14,7 +14,7 @@ require('copilot').setup({
}, },
filetypes = { filetypes = {
yaml = false, yaml = false,
markdown = false, markdown = true,
help = false, help = false,
gitcommit = false, gitcommit = false,
gitrebase = false, gitrebase = false,

View file

@ -0,0 +1,29 @@
local dap = require("dap")
dap.adapters.lldb = {
type = 'server',
port = "${port}",
executable = {
command = '/Users/afonso/.local/share/nvim/mason/bin/codelldb',
args = {"--port", "${port}"},
}
}
dap.configurations.c = {
{
name = "codelldb: With args",
type = "codelldb",
request = "launch",
program = function()
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
end,
args = function()
local args = vim.fn.input('Arguments: ')
return args ~= '' and { args } or nil
end,
cwd = '${workspaceFolder}',
stopOnEntry = false,
},
}

View file

@ -1,4 +1,6 @@
local opts = { noremap = true, silent = true, buffer = true } local opts = { noremap = true, silent = true, buffer = true }
--Convert between py and ipynb
vim.keymap.set('n', '<leader>jnp', '<cmd>call jukit#convert#notebook_convert()<CR>', opts)
-- Create new code cell below. Argument: Whether to create code cell (0) or markdown cell (1) -- Create new code cell below. Argument: Whether to create code cell (0) or markdown cell (1)
vim.keymap.set('n', '<leader>jco', '<cmd>call jukit#cells#create_below(0)<CR>', opts) vim.keymap.set('n', '<leader>jco', '<cmd>call jukit#cells#create_below(0)<CR>', opts)
-- Create new code cell above. Argument: Whether to create code cell (0) or markdown cell (1) -- Create new code cell above. Argument: Whether to create code cell (0) or markdown cell (1)

View file

@ -10,19 +10,7 @@ lazy.setup({
name = "catppuccin", name = "catppuccin",
lazy = false, lazy = false,
priority = 1000, priority = 1000,
config = function() opts = {}
require("catppuccin").setup({
integrations = {
cmp = true,
treesitter = true,
treesitter_context = true,
fidget = true,
telescope = true,
leap = true,
mason = true,
},
})
end
}, },
'sainnhe/gruvbox-material', 'sainnhe/gruvbox-material',
@ -30,33 +18,24 @@ lazy.setup({
-------------------------------------------------------MFP--------------------------------- -------------------------------------------------------MFP---------------------------------
{ {
'susliko/tla.nvim', 'susliko/tla.nvim',
config = function() opts = {}
require("tla").setup()
end
}, },
-------------------------------------------------------QOL--------------------------------- -------------------------------------------------------QOL---------------------------------
{ {
'chipsenkbeil/distant.nvim', 'jbyuki/instant.nvim',
branch = 'v0.3',
config = function() config = function()
require('distant'):setup({ vim.g.instant_username = 'afonso'
servers = {
['10.8.0.9'] = {
launch = {
default = {
username = 'afonso',
args = '--port 8080 --shutdown lonely=1'
}
}
},
}
})
end end
}, },
'vimpostor/vim-tpipeline', 'vimpostor/vim-tpipeline',
{
'TobinPalmer/pastify.nvim',
cmd = { 'Pastify' },
opts = {}
},
--Python notebooks --Python notebooks
{ {
@ -66,24 +45,6 @@ lazy.setup({
end, end,
ft = { 'python', 'json' } ft = { 'python', 'json' }
}, },
--org mode
{
'nvim-orgmode/orgmode',
dependencies = {
{ 'nvim-treesitter/nvim-treesitter', lazy = true },
},
event = 'VeryLazy',
config = function()
-- Load treesitter grammar for org
require('orgmode').setup_ts_grammar()
-- Setup orgmode
require('orgmode').setup({
org_agenda_files = '~/org/**/*',
org_default_notes_file = '~/org/refile.org',
})
end,
},
{ {
"zbirenbaum/copilot.lua", "zbirenbaum/copilot.lua",
@ -93,55 +54,31 @@ lazy.setup({
require 'plugins.copilot' require 'plugins.copilot'
end, end,
}, },
--better navigation with 's-letter'
{
'ggandor/leap.nvim',
event = "VeryLazy",
config = function()
require('leap').add_default_mappings()
end
},
--Nvim to browser --Nvim to browser
'subnut/nvim-ghost.nvim', 'subnut/nvim-ghost.nvim',
{
'2kabhishek/nerdy.nvim',
event = "VeryLazy",
dependencies = {
'stevearc/dressing.nvim',
'nvim-telescope/telescope.nvim',
},
cmd = 'Nerdy',
},
{ {
'declancm/cinnamon.nvim', 'declancm/cinnamon.nvim',
config = function() opts = {
require('cinnamon').setup { scroll_limit = 10000,
scroll_limit = 10000, always_scroll = true,
always_scroll = true, }
}
end
}, },
{ {
"folke/todo-comments.nvim", "folke/todo-comments.nvim",
event = "VeryLazy", event = "VeryLazy",
dependencies = { "nvim-lua/plenary.nvim" }, dependencies = { "nvim-lua/plenary.nvim" },
config = function() opts = {}
require("todo-comments").setup {}
end
}, },
{ {
'folke/zen-mode.nvim', 'folke/zen-mode.nvim',
event = "VeryLazy", event = "VeryLazy",
config = function() opts = {
require("zen-mode").setup { vim.keymap.set('n', '<leader>z', '<Cmd> ZenMode <CR>', { noremap = true, silent = true })
vim.keymap.set('n', '<leader>z', '<Cmd> ZenMode <CR>', { noremap = true, silent = true }) }
}
end
}, },
--Change add and remove surroundings from words --Change add and remove surroundings from words
@ -149,82 +86,28 @@ lazy.setup({
{ {
'NvChad/nvim-colorizer.lua', 'NvChad/nvim-colorizer.lua',
config = function() opts = {}
require 'colorizer'.setup()
end
}, },
-- {
-- "roobert/tailwindcss-colorizer-cmp.nvim",
-- event = "VeryLazy",
-- config = function()
-- require("tailwindcss-colorizer-cmp").setup({
-- color_square_width = 2,
-- })
-- end
-- },
-- {
-- 'laytan/tailwind-sorter.nvim',
-- event = "VeryLazy",
-- dependencies = { 'nvim-treesitter/nvim-treesitter', 'nvim-lua/plenary.nvim' },
-- build = 'cd formatter && bun i && bun run build',
-- config = true,
-- },
--Database integration
-- 'tpope/vim-dadbod',
-- {
-- 'kristijanhusak/vim-dadbod-ui',
-- config = function()
-- vim.g.db_ui_auto_execute_table_helpers = 1
-- end
-- },
-- 'kristijanhusak/vim-dadbod-completion',
'mbbill/undotree', 'mbbill/undotree',
--Tmux navigation --Tmux navigation
{ {
'alexghergh/nvim-tmux-navigation', 'alexghergh/nvim-tmux-navigation',
config = function() opts = {
require 'nvim-tmux-navigation'.setup { disable_when_zoomed = true, -- defaults to false
disable_when_zoomed = true, -- defaults to false keybindings = {
keybindings = { left = "<F5>",
left = "<F5>", down = "<F6>",
down = "<F6>", up = "<F7>",
up = "<F7>", right = "<F8>",
right = "<F8>",
}
} }
end }
}, },
-- Rename variable pop up -- Rename variable pop up
'stevearc/dressing.nvim', 'stevearc/dressing.nvim',
-- {
-- 'krady21/compiler-explorer.nvim',
-- event = "VeryLazy",
-- config = function()
-- require("compiler-explorer").setup({
-- url = "https://godbolt.org",
-- infer_lang = true, -- Try to infer possible language based on file extension.
-- line_match = {
-- highlight = true, -- highlight the matching line(s) in the other buffer.
-- jump = true, -- move the cursor in the other buffer to the first matching line.
-- },
-- open_qflist = true, -- Open qflist after compilation if there are diagnostics.
-- split = "split", -- How to split the window after the second compile (split/vsplit).
-- compiler_flags = "", -- Default flags passed to the compiler.
-- job_timeout_ms = 25000, -- Timeout for libuv job in milliseconds.
-- languages = { -- Language specific default compiler/flags
-- c = {
-- compiler = "cg132"
-- }
-- },
-- })
-- end
-- },
{ {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
config = function() config = function()
@ -244,9 +127,7 @@ lazy.setup({
{ {
'stevearc/oil.nvim', 'stevearc/oil.nvim',
config = function() opts = {}
require("oil").setup()
end
}, },
-------------------------------------------------------LSP---------------------------------------------- -------------------------------------------------------LSP----------------------------------------------
@ -303,6 +184,9 @@ lazy.setup({
}, },
{ {
"mfussenegger/nvim-dap", "mfussenegger/nvim-dap",
config = function()
require 'plugins.dap'
end
}, },
{ {
@ -331,12 +215,17 @@ lazy.setup({
{ {
'lervag/vimtex', 'lervag/vimtex',
event = "VeryLazy",
config = function() config = function()
require 'plugins.vimtex' require 'plugins.vimtex'
end end
}, },
{
'mrcjkb/rustaceanvim',
version = '^4', -- Recommended
ft = { 'rust' },
},
------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------
-- Syntax Highlighting -- Syntax Highlighting
{ {
@ -358,16 +247,6 @@ lazy.setup({
"runoshun/vim-alloy", "runoshun/vim-alloy",
--Tabs
--{
-- 'akinsho/bufferline.nvim',
-- version = 'v3.*',
-- dependencies = 'nvim-tree/nvim-web-devicons',
-- config = function()
-- require("plugins.bufferline")
-- end
--},
--does so much --does so much
{ {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
@ -377,34 +256,6 @@ lazy.setup({
config = function() require('plugins.telescope') end config = function() require('plugins.telescope') end
}, },
--Main menu
-- {
-- 'startup-nvim/startup.nvim',
-- dependencies = { 'nvim-telescope/telescope.nvim', 'nvim-lua/plenary.nvim' },
-- config = function()
-- require('startup').setup { theme = 'dashboard' }
-- end,
-- },
-------------------------------------------OTHERS----------------------------------------------
-- {
-- "nvim-neorg/neorg",
-- build = ":Neorg sync-parsers",
-- config = function()
-- require("neorg").setup {
-- load = {
-- ["core.defaults"] = {}, -- Loads default behaviour
-- ["core.concealer"] = {} -- Adds pretty icons to your documents
-- },
-- }
-- end,
-- dependencies = { "nvim-lua/plenary.nvim" },
-- },
-- 'kmonad/kmonad-vim',
-- 'elkowar/yuck.vim',
--Discord Rich Presence --Discord Rich Presence
'andweeb/presence.nvim' 'andweeb/presence.nvim'

View file

@ -60,8 +60,16 @@ mason_lspconfig.setup_handlers {
end, end,
} }
lspconfig["ocamllsp"].setup{ lspconfig["ocamllsp"].setup {
on_attach = on_attach, on_attach = on_attach,
flags = lsp_flags, flags = lsp_flags,
capabilities = capabilities, capabilities = capabilities,
}
vim.g.rustaceanvim = {
server = {
on_attach = on_attach,
flags = lsp_flags,
capabilities = capabilities
},
} }

View file

@ -3,12 +3,8 @@ local null_ls = require("null-ls")
null_ls.setup({ null_ls.setup({
sources = { sources = {
null_ls.builtins.formatting.rustfmt,
null_ls.builtins.formatting.black, null_ls.builtins.formatting.black,
null_ls.builtins.diagnostics.flake8,
null_ls.builtins.formatting.gofmt, null_ls.builtins.formatting.gofmt,
null_ls.builtins.code_actions.shellcheck,
null_ls.builtins.formatting.beautysh,
null_ls.builtins.formatting.prettierd.with({ null_ls.builtins.formatting.prettierd.with({
filetypes = { "html", "json", "css", "js", "yaml", "markdown" }, filetypes = { "html", "json", "css", "js", "yaml", "markdown" },
}), }),

View file

@ -1,2 +1,2 @@
vim.g.vimtex_view_method = 'zathura' vim.g.vimtex_view_method = 'skim'
vim.g.vimtex_compiler_methor = 'latexmk' vim.g.vimtex_compiler_methor = 'pdflatex'