|
|
|
@ -102,7 +102,7 @@ vim.g.have_nerd_font = false
|
|
|
|
|
vim.opt.number = true
|
|
|
|
|
-- You can also add relative line numbers, to help with jumping.
|
|
|
|
|
-- Experiment for yourself to see if you like it!
|
|
|
|
|
-- vim.opt.relativenumber = true
|
|
|
|
|
vim.opt.relativenumber = true
|
|
|
|
|
|
|
|
|
|
-- Enable mouse mode, can be useful for resizing splits for example!
|
|
|
|
|
vim.opt.mouse = 'a'
|
|
|
|
@ -185,10 +185,18 @@ vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' }
|
|
|
|
|
-- Use CTRL+<hjkl> to switch between windows
|
|
|
|
|
--
|
|
|
|
|
-- See `:help wincmd` for a list of all window commands
|
|
|
|
|
vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
|
|
|
vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
|
|
|
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
|
|
|
|
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
|
|
|
|
-- vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
|
|
|
-- vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
|
|
|
-- vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
|
|
|
|
-- vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
|
|
|
|
|
|
|
|
|
-- split windows
|
|
|
|
|
vim.keymap.set("n", "<leader>sv", "<C-w>v") -- split veritcally
|
|
|
|
|
vim.keymap.set("n", "<leader>sh", "<C-w>s") -- split horizontally
|
|
|
|
|
vim.keymap.set("n", "<leader>se", "<C-w>=") -- equal windows
|
|
|
|
|
vim.keymap.set("n", "<leader>sx", ":close<CR>") -- close
|
|
|
|
|
|
|
|
|
|
vim.keymap.set('i', 'jk', '<ESC>')
|
|
|
|
|
|
|
|
|
|
-- [[ Basic Autocommands ]]
|
|
|
|
|
-- See `:help lua-guide-autocommands`
|
|
|
|
@ -353,11 +361,15 @@ require('lazy').setup({
|
|
|
|
|
-- You can put your default mappings / updates / etc. in here
|
|
|
|
|
-- All the info you're looking for is in `:help telescope.setup()`
|
|
|
|
|
--
|
|
|
|
|
-- defaults = {
|
|
|
|
|
-- mappings = {
|
|
|
|
|
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
|
|
|
|
-- },
|
|
|
|
|
-- },
|
|
|
|
|
defaults = {
|
|
|
|
|
mappings = {
|
|
|
|
|
i = {
|
|
|
|
|
['<C-k>'] = require('telescope.actions').move_selection_previous, -- move to prev result
|
|
|
|
|
['<C-j>'] = require('telescope.actions').move_selection_next, -- move to next result
|
|
|
|
|
['<C-q>'] = require('telescope.actions').send_selected_to_qflist + require('telescope.actions').open_qflist, -- send selected to quickfixlist
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
-- pickers = {}
|
|
|
|
|
extensions = {
|
|
|
|
|
['ui-select'] = {
|
|
|
|
@ -640,18 +652,23 @@ require('lazy').setup({
|
|
|
|
|
},
|
|
|
|
|
opts = {
|
|
|
|
|
notify_on_error = false,
|
|
|
|
|
format_on_save = function(bufnr)
|
|
|
|
|
-- Disable "format_on_save lsp_fallback" for languages that don't
|
|
|
|
|
-- have a well standardized coding style. You can add additional
|
|
|
|
|
-- languages here or re-enable it for the disabled ones.
|
|
|
|
|
local disable_filetypes = { c = true, cpp = true }
|
|
|
|
|
return {
|
|
|
|
|
timeout_ms = 500,
|
|
|
|
|
lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
|
|
|
}
|
|
|
|
|
end,
|
|
|
|
|
-- format_on_save = function(bufnr)
|
|
|
|
|
-- -- Disable "format_on_save lsp_fallback" for languages that don't
|
|
|
|
|
-- -- have a well standardized coding style. You can add additional
|
|
|
|
|
-- -- languages here or re-enable it for the disabled ones.
|
|
|
|
|
-- local disable_filetypes = { c = true, cpp = true }
|
|
|
|
|
-- return {
|
|
|
|
|
-- timeout_ms = 500,
|
|
|
|
|
-- lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
|
|
|
-- }
|
|
|
|
|
-- end,
|
|
|
|
|
formatters_by_ft = {
|
|
|
|
|
lua = { 'stylua' },
|
|
|
|
|
javascript = { { 'prettierd', 'prettier' } },
|
|
|
|
|
javascriptreact = { { 'prettierd', 'prettier' } },
|
|
|
|
|
typescript = { { 'prettierd', 'prettier' } },
|
|
|
|
|
typescriptreact = { { 'prettierd', 'prettier' } },
|
|
|
|
|
python = { 'ruff_format', 'ruff_fix' },
|
|
|
|
|
-- Conform can also run multiple formatters sequentially
|
|
|
|
|
-- python = { "isort", "black" },
|
|
|
|
|
--
|
|
|
|
@ -718,9 +735,9 @@ require('lazy').setup({
|
|
|
|
|
-- No, but seriously. Please read `:help ins-completion`, it is really good!
|
|
|
|
|
mapping = cmp.mapping.preset.insert {
|
|
|
|
|
-- Select the [n]ext item
|
|
|
|
|
['<C-n>'] = cmp.mapping.select_next_item(),
|
|
|
|
|
['<C-j>'] = cmp.mapping.select_next_item(),
|
|
|
|
|
-- Select the [p]revious item
|
|
|
|
|
['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
|
|
|
['<C-k>'] = cmp.mapping.select_prev_item(),
|
|
|
|
|
|
|
|
|
|
-- Scroll the documentation window [b]ack / [f]orward
|
|
|
|
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
|
|
@ -729,7 +746,7 @@ require('lazy').setup({
|
|
|
|
|
-- Accept ([y]es) the completion.
|
|
|
|
|
-- This will auto-import if your LSP supports it.
|
|
|
|
|
-- This will expand snippets if the LSP sent a snippet.
|
|
|
|
|
['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
['<CR>'] = cmp.mapping.confirm { select = true },
|
|
|
|
|
|
|
|
|
|
-- If you prefer more traditional completion keymaps,
|
|
|
|
|
-- you can uncomment the following lines
|
|
|
|
@ -810,7 +827,12 @@ require('lazy').setup({
|
|
|
|
|
-- - saiw) - [S]urround [A]dd [I]nner [W]ord [)]Paren
|
|
|
|
|
-- - sd' - [S]urround [D]elete [']quotes
|
|
|
|
|
-- - sr)' - [S]urround [R]eplace [)] [']
|
|
|
|
|
require('mini.surround').setup()
|
|
|
|
|
-- require('mini.surround').setup()
|
|
|
|
|
require('mini.indentscope').setup {
|
|
|
|
|
draw = {
|
|
|
|
|
animation = require('mini.indentscope').gen_animation.none(),
|
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
-- Simple and easy statusline.
|
|
|
|
|
-- You could remove this setup call if you don't like it,
|
|
|
|
@ -835,7 +857,28 @@ require('lazy').setup({
|
|
|
|
|
'nvim-treesitter/nvim-treesitter',
|
|
|
|
|
build = ':TSUpdate',
|
|
|
|
|
opts = {
|
|
|
|
|
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
|
|
|
|
|
ensure_installed = {
|
|
|
|
|
'json',
|
|
|
|
|
'javascript',
|
|
|
|
|
'typescript',
|
|
|
|
|
'tsx',
|
|
|
|
|
'yaml',
|
|
|
|
|
'html',
|
|
|
|
|
'css',
|
|
|
|
|
'markdown',
|
|
|
|
|
'markdown_inline',
|
|
|
|
|
'svelte',
|
|
|
|
|
'graphql',
|
|
|
|
|
'bash',
|
|
|
|
|
'lua',
|
|
|
|
|
'vim',
|
|
|
|
|
'dockerfile',
|
|
|
|
|
'gitignore',
|
|
|
|
|
'python',
|
|
|
|
|
'toml',
|
|
|
|
|
'prisma',
|
|
|
|
|
'vue',
|
|
|
|
|
},
|
|
|
|
|
-- Autoinstall languages that are not installed
|
|
|
|
|
auto_install = true,
|
|
|
|
|
highlight = {
|
|
|
|
@ -864,6 +907,7 @@ require('lazy').setup({
|
|
|
|
|
end,
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- The following two comments only work if you have downloaded the kickstart repo, not just copy pasted the
|
|
|
|
|
-- init.lua. If you want these files, they are in the repository, so you can just download them and
|
|
|
|
|
-- place them in the correct locations.
|
|
|
|
@ -876,16 +920,16 @@ require('lazy').setup({
|
|
|
|
|
-- require 'kickstart.plugins.debug',
|
|
|
|
|
-- require 'kickstart.plugins.indent_line',
|
|
|
|
|
-- require 'kickstart.plugins.lint',
|
|
|
|
|
-- require 'kickstart.plugins.autopairs',
|
|
|
|
|
-- require 'kickstart.plugins.neo-tree',
|
|
|
|
|
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
|
|
|
|
require 'kickstart.plugins.autopairs',
|
|
|
|
|
require 'kickstart.plugins.neo-tree',
|
|
|
|
|
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`
|
|
|
|
|
-- This is the easiest way to modularize your config.
|
|
|
|
|
--
|
|
|
|
|
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
|
|
|
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
|
|
|
|
-- { import = 'custom.plugins' },
|
|
|
|
|
{ import = 'custom.plugins' },
|
|
|
|
|
}, {
|
|
|
|
|
ui = {
|
|
|
|
|
-- If you are using a Nerd Font: set icons to an empty table which will use the
|
|
|
|
|