Add customizations
This commit is contained in:
parent
93fde0556e
commit
af39dd4a9f
13 changed files with 151 additions and 28 deletions
19
lua/custom/init.lua
Normal file
19
lua/custom/init.lua
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
-- Fold code by expression
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.foldmethod = 'expr'
|
||||
vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
||||
-- Turn off line wrapping
|
||||
vim.opt.wrap = false
|
||||
|
||||
-- Typst filetype support
|
||||
vim.filetype.add { extension = { typ = 'typst' } }
|
||||
|
||||
-- Reset the cursor after leaving vim. Without this, the cursor changes to a
|
||||
-- block for the terminal.
|
||||
vim.cmd [[
|
||||
augroup RestoreCursorShapeOnExit
|
||||
autocmd!
|
||||
autocmd VimLeave * set guicursor=a:ver1
|
||||
augroup END
|
||||
]]
|
||||
25
lua/custom/keymap.lua
Normal file
25
lua/custom/keymap.lua
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
-- Custom keychains
|
||||
require('which-key').register {
|
||||
['<leader>p'] = { name = '[P]ython', _ = 'which_key_ignore' },
|
||||
}
|
||||
-- Undo
|
||||
vim.keymap.set("n", "<leader>su", require("telescope").extensions.undo.undo, { desc = '[S]earch [U]ndo' })
|
||||
|
||||
-- Lazygit
|
||||
vim.keymap.set("n", "<leader>gg", ":LazyGit<CR>", { desc = "[G]it Lazy[G]it" })
|
||||
|
||||
-- Debug
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>pm", function() require("dap-python").test_method() end,
|
||||
{ desc = '[P]ython Debug [M]ethod' })
|
||||
vim.keymap.set({ "n", "v" }, "<Leader>pc", function() require("dap-python").test_class() end,
|
||||
{ desc = '[P]ython Debug [C]lass' })
|
||||
vim.keymap.set("v", "<Leader>k", function() require("dapui").eval() end, { desc = "Debug: Eval" })
|
||||
|
||||
-- Navigate buffers
|
||||
vim.keymap.set("n", "<leader>l", ":ls<CR>:b<space>", { desc = "Select buffer" })
|
||||
|
||||
-- Make
|
||||
vim.keymap.set("n", "<leader>m", ":make <CR>", { desc = "[M]ake" })
|
||||
|
||||
-- Telescope undo
|
||||
vim.keymap.set("n", "<leader>su", require("telescope").extensions.undo.undo, { desc = '[S]earch [U]ndo' })
|
||||
7
lua/custom/lazygit.lua
Normal file
7
lua/custom/lazygit.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
"kdheepak/lazygit.nvim",
|
||||
-- optional for floating window border decoration
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
}
|
||||
}
|
||||
15
lua/custom/plugins/autopairs.lua
Normal file
15
lua/custom/plugins/autopairs.lua
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
return {
|
||||
"windwp/nvim-autopairs",
|
||||
-- Optional dependency
|
||||
dependencies = { 'hrsh7th/nvim-cmp' },
|
||||
config = function()
|
||||
require("nvim-autopairs").setup {}
|
||||
-- If you want to automatically add `(` after selecting a function or method
|
||||
local cmp_autopairs = require('nvim-autopairs.completion.cmp')
|
||||
local cmp = require('cmp')
|
||||
cmp.event:on(
|
||||
'confirm_done',
|
||||
cmp_autopairs.on_confirm_done()
|
||||
)
|
||||
end,
|
||||
}
|
||||
11
lua/custom/plugins/neo-tree.lua
Normal file
11
lua/custom/plugins/neo-tree.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
--- File explorer
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-tree/nvim-web-devicons", -- not strictly required, but recommended
|
||||
"MunifTanjim/nui.nvim",
|
||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
||||
}
|
||||
}
|
||||
5
lua/custom/plugins/rustaceanvim.lua
Normal file
5
lua/custom/plugins/rustaceanvim.lua
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
return {
|
||||
'mrcjkb/rustaceanvim',
|
||||
version = '^4', -- Recommended
|
||||
ft = { 'rust' },
|
||||
}
|
||||
6
lua/custom/plugins/typst_lsp.lua
Normal file
6
lua/custom/plugins/typst_lsp.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
return { require 'lspconfig'.typst_lsp.setup {
|
||||
settings = {
|
||||
exportPdf = "never" -- Choose onType, onSave or never.
|
||||
-- serverPath = "" -- Normally, there is no need to uncomment it.
|
||||
}
|
||||
} }
|
||||
9
lua/custom/plugins/vim-tmux-navigator.lua
Normal file
9
lua/custom/plugins/vim-tmux-navigator.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
-- Seamless navigation between tmux panes and vim splits
|
||||
'christoomey/vim-tmux-navigator',
|
||||
config = function()
|
||||
-- disable netrw for nvim-tree
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
end,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue