fix formatter and add keymaps to init.lua
This commit is contained in:
parent
b1bbff8470
commit
fd3d096603
2 changed files with 121 additions and 2 deletions
15
init.lua
15
init.lua
|
|
@ -206,6 +206,16 @@ vim.keymap.set('n', '<leader>j', '<cmd>lprev<CR>zz')
|
|||
|
||||
vim.keymap.set('n', '<leader>x', '<cmd>!chmod +x %<CR>', { silent = true })
|
||||
|
||||
|
||||
-- formatter autoformat on save
|
||||
local augroup = vim.api.nvim_create_augroup
|
||||
local autocmd = vim.api.nvim_create_autocmd
|
||||
augroup("__formatter__", { clear = true })
|
||||
autocmd("BufWritePost", {
|
||||
group = "__formatter__",
|
||||
command = ":FormatWrite",
|
||||
})
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
--
|
||||
|
|
@ -908,7 +918,7 @@ require('lazy').setup({
|
|||
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
|
||||
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
|
||||
opts = {
|
||||
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
|
||||
ensure_installed = { 'bash', 'astro', 'scala', 'c', 'go', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'java', 'javascript', 'typescript' },
|
||||
-- Autoinstall languages that are not installed
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
|
|
@ -924,7 +934,7 @@ require('lazy').setup({
|
|||
-- with nvim-treesitter. You should go explore a few and see what interests you:
|
||||
--
|
||||
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
|
||||
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
|
||||
-- - Show your current context: https://:github.com/nvim-treesitter/nvim-treesitter-context
|
||||
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
|
||||
},
|
||||
|
||||
|
|
@ -944,6 +954,7 @@ require('lazy').setup({
|
|||
require 'kickstart.plugins.neo-tree',
|
||||
require 'custom.plugins.harpoon',
|
||||
require 'custom.plugins.copilot',
|
||||
require 'custom.plugins.formatter',
|
||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue