feat: personalize config
This commit is contained in:
parent
5aeddfdd5d
commit
b4fb4b6076
40
init.lua
40
init.lua
|
@ -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'
|
||||
|
@ -176,10 +176,10 @@ vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagn
|
|||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||
|
||||
-- TIP: Disable arrow keys in normal mode
|
||||
-- vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
-- vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
vim.keymap.set('n', '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||
vim.keymap.set('n', '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||
vim.keymap.set('n', '<up>', '<cmd>echo "Use k to move!!"<CR>')
|
||||
vim.keymap.set('n', '<down>', '<cmd>echo "Use j to move!!"<CR>')
|
||||
|
||||
-- Keybinds to make split navigation easier.
|
||||
-- Use CTRL+<hjkl> to switch between windows
|
||||
|
@ -190,6 +190,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||
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' })
|
||||
|
||||
-- Remap <C-d> and <C-u> to also center cursor on page
|
||||
vim.keymap.set('n', '<C-d>', '<C-d>zz')
|
||||
vim.keymap.set('n', '<C-u>', '<C-u>zz')
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
|
@ -630,6 +634,7 @@ require('lazy').setup({
|
|||
lazy = false,
|
||||
keys = {
|
||||
{
|
||||
-- Format file on command
|
||||
'<leader>f',
|
||||
function()
|
||||
require('conform').format { async = true, lsp_fallback = true }
|
||||
|
@ -657,7 +662,16 @@ require('lazy').setup({
|
|||
--
|
||||
-- You can use a sub-list to tell conform to run *until* a formatter
|
||||
-- is found.
|
||||
-- javascript = { { "prettierd", "prettier" } },
|
||||
javascript = { { 'prettierd', 'prettier' } },
|
||||
typescript = { { 'prettierd', 'prettier' } },
|
||||
javascriptreact = { { 'prettierd', 'prettier' } },
|
||||
typescriptreact = { { 'prettierd', 'prettier' } },
|
||||
css = { { 'prettierd', 'prettier' } },
|
||||
html = { { 'prettierd', 'prettier' } },
|
||||
json = { { 'prettierd', 'prettier' } },
|
||||
yaml = { { 'prettierd', 'prettier' } },
|
||||
markdown = { { 'prettierd', 'prettier' } },
|
||||
python = { 'isort', 'black' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
@ -864,6 +878,13 @@ require('lazy').setup({
|
|||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'nvim-neorg/neorg',
|
||||
lazy = false, -- Disable lazy loading as some `lazy.nvim` distributions set `lazy = true` by default
|
||||
version = '*', -- Pin Neorg to the latest stable release
|
||||
config = true,
|
||||
},
|
||||
|
||||
-- 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.
|
||||
|
@ -873,9 +894,10 @@ require('lazy').setup({
|
|||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug',
|
||||
-- require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.indent_line',
|
||||
require 'kickstart.plugins.lint',
|
||||
require 'kickstart.plugins.neotest',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
-- require 'kickstart.plugins.neo-tree',
|
||||
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
|
|
@ -7,6 +7,11 @@ return {
|
|||
local lint = require 'lint'
|
||||
lint.linters_by_ft = {
|
||||
markdown = { 'markdownlint' },
|
||||
javascript = { 'eslint_d' },
|
||||
typescript = { 'eslint_d' },
|
||||
javascriptreact = { 'eslint_d' },
|
||||
typescriptreact = { 'eslint_d' },
|
||||
python = { 'pylint' },
|
||||
}
|
||||
|
||||
-- To allow other plugins to add linters to require('lint').linters_by_ft,
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
return {
|
||||
'nvim-neotest/neotest',
|
||||
dependencies = { 'haydenmeade/neotest-jest' },
|
||||
config = function()
|
||||
require('neotest').setup {
|
||||
adapters = {
|
||||
require 'neotest-jest' {
|
||||
jestCommand = 'npm test --',
|
||||
jestConfigFile = 'custom.jest.config.ts',
|
||||
env = { CI = true },
|
||||
cwd = function()
|
||||
return vim.fn.getcwd()
|
||||
end,
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
}
|
Loading…
Reference in New Issue