some changes
This commit is contained in:
parent
8cd6349334
commit
96f1792c09
3 changed files with 93 additions and 73 deletions
|
|
@ -40,6 +40,18 @@ vim.o.undofile = true
|
||||||
-- instead raise a dialog asking if you wish to save the current file(s) See `:help 'confirm'`
|
-- instead raise a dialog asking if you wish to save the current file(s) See `:help 'confirm'`
|
||||||
vim.o.confirm = true
|
vim.o.confirm = true
|
||||||
|
|
||||||
|
-- local toggle_background = function (obj)
|
||||||
|
-- print(string.find(obj.stdout, "prefer-light"))
|
||||||
|
-- if string.find(obj.stdout, "prefer-light") then
|
||||||
|
-- print('light')
|
||||||
|
-- else
|
||||||
|
-- print('dark')
|
||||||
|
-- end
|
||||||
|
-- end
|
||||||
|
--
|
||||||
|
-- vim.o.background = 'light'
|
||||||
|
-- vim.system({"dconf", "read", "/org/gnome/desktop/interface/color-scheme"}, toggle_background)
|
||||||
|
|
||||||
vim.cmd.colorscheme("gruvbox")
|
vim.cmd.colorscheme("gruvbox")
|
||||||
|
|
||||||
-- [[ Set up keymaps ]] See `:h vim.keymap.set()`, `:h mapping`, `:h keycodes`
|
-- [[ Set up keymaps ]] See `:h vim.keymap.set()`, `:h mapping`, `:h keycodes`
|
||||||
|
|
@ -110,10 +122,10 @@ vim.filetype.add({
|
||||||
|
|
||||||
-- Install nvim-treesitter
|
-- Install nvim-treesitter
|
||||||
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
|
vim.pack.add({ "https://github.com/nvim-treesitter/nvim-treesitter" })
|
||||||
require("nvim-treesitter").setup()
|
require("nvim-treesitter").install({ 'fish', 'java', 'latex', 'make'})
|
||||||
|
|
||||||
vim.api.nvim_create_autocmd('FileType', {
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
pattern = {'<filetype>', 'tex'},
|
pattern = {'<filetype>'},
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.treesitter.start()
|
vim.treesitter.start()
|
||||||
end,
|
end,
|
||||||
|
|
@ -153,10 +165,10 @@ vim.keymap.set("n", "<leader>dN", "]D", { desc = "Jump to last diagnostic" })
|
||||||
vim.keymap.set("n", "<leader>dP", "[D", { desc = "Jump to first diagnostic" })
|
vim.keymap.set("n", "<leader>dP", "[D", { desc = "Jump to first diagnostic" })
|
||||||
vim.keymap.set("n", "<leader>ds", "<C-w>d", { desc = "Display diagnostic on current line" })
|
vim.keymap.set("n", "<leader>ds", "<C-w>d", { desc = "Display diagnostic on current line" })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('FileType', {
|
||||||
vim.api.nvim_create_user_command("DapInit", function()
|
pattern = {'c', 'cpp', 'rust'},
|
||||||
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap" })
|
callback = function()
|
||||||
|
vim.pack.add({ "https://github.com/mfussenegger/nvim-dap", "https://github.com/theHamsta/nvim-dap-virtual-text" })
|
||||||
local dap = require("dap")
|
local dap = require("dap")
|
||||||
local dap_widgets = require("dap.ui.widgets")
|
local dap_widgets = require("dap.ui.widgets")
|
||||||
local dap_sidebar_s = dap_widgets.sidebar(dap_widgets.scopes)
|
local dap_sidebar_s = dap_widgets.sidebar(dap_widgets.scopes)
|
||||||
|
|
@ -165,8 +177,9 @@ vim.api.nvim_create_user_command("DapInit", function()
|
||||||
vim.keymap.set("n", "<leader>bb", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
vim.keymap.set("n", "<leader>bb", dap.toggle_breakpoint, { desc = "Toggle breakpoint" })
|
||||||
vim.keymap.set("n", "<leader>bc", dap.continue, { desc = "Continue execution" })
|
vim.keymap.set("n", "<leader>bc", dap.continue, { desc = "Continue execution" })
|
||||||
dap.listeners.on_session["debug"] = function()
|
dap.listeners.on_session["debug"] = function()
|
||||||
vim.keymap.set("n", "<leader>bs", dap_sidebar_s.toggle, { desc = "Show scopes" })
|
vim.keymap.set("n", "<leader>bs", dap_sidebar_s.toggle, { desc = "Toggle scopes" })
|
||||||
vim.keymap.set("n", "<leader>bf", dap_sidebar_f.toggle, { desc = "Show frames" })
|
vim.keymap.set("n", "<leader>bf", dap_sidebar_f.toggle, { desc = "Toggle frames" })
|
||||||
|
vim.keymap.set("n", "<leader>br", dap.repl.toggle, { desc = "Toggle REPL"})
|
||||||
|
|
||||||
vim.keymap.set("n", "<Left>", dap.step_out, { desc = "Step out" })
|
vim.keymap.set("n", "<Left>", dap.step_out, { desc = "Step out" })
|
||||||
vim.keymap.set("n", "<Right>", dap.step_into, { desc = "Step into" })
|
vim.keymap.set("n", "<Right>", dap.step_into, { desc = "Step into" })
|
||||||
|
|
@ -219,7 +232,8 @@ vim.api.nvim_create_user_command("DapInit", function()
|
||||||
|
|
||||||
dap.configurations.cpp = dap.configurations.c
|
dap.configurations.cpp = dap.configurations.c
|
||||||
dap.configurations.rust = dap.configurations.c
|
dap.configurations.rust = dap.configurations.c
|
||||||
end, { desc = "Initialize Debug Adater Protocol support" })
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- [[ UI Configuration ]]
|
-- [[ UI Configuration ]]
|
||||||
vim.pack.add({ "https://github.com/nvim-mini/mini.nvim" })
|
vim.pack.add({ "https://github.com/nvim-mini/mini.nvim" })
|
||||||
|
|
|
||||||
|
|
@ -147,14 +147,16 @@ return {
|
||||||
forwardSearch = {
|
forwardSearch = {
|
||||||
executable = 'sioyek',
|
executable = 'sioyek',
|
||||||
args = {
|
args = {
|
||||||
|
'--reuse-window',
|
||||||
|
'--execute-command',
|
||||||
|
'toggle_synctex',
|
||||||
'--inverse-search',
|
'--inverse-search',
|
||||||
'--reuse-instance',
|
'texlab inverse-search -i \"%%1\" -l %%2',
|
||||||
'file:%p#src:%l%f',
|
|
||||||
'--forward-search-file',
|
'--forward-search-file',
|
||||||
'%f',
|
'%f',
|
||||||
'--forward-search-line',
|
'--forward-search-line',
|
||||||
'%l',
|
'%l',
|
||||||
'%p'
|
'%p',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
chktex = {
|
chktex = {
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,10 @@
|
||||||
"rev": "cdfd55a133f63228c55f91378f12908cb2a78ded",
|
"rev": "cdfd55a133f63228c55f91378f12908cb2a78ded",
|
||||||
"src": "https://github.com/mfussenegger/nvim-dap"
|
"src": "https://github.com/mfussenegger/nvim-dap"
|
||||||
},
|
},
|
||||||
|
"nvim-dap-ui": {
|
||||||
|
"rev": "cf91d5e2d07c72903d052f5207511bf7ecdb7122",
|
||||||
|
"src": "https://github.com/rcarriga/nvim-dap-ui"
|
||||||
|
},
|
||||||
"nvim-dap-virtual-text": {
|
"nvim-dap-virtual-text": {
|
||||||
"rev": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6",
|
"rev": "fbdb48c2ed45f4a8293d0d483f7730d24467ccb6",
|
||||||
"src": "https://github.com/theHamsta/nvim-dap-virtual-text"
|
"src": "https://github.com/theHamsta/nvim-dap-virtual-text"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue