Skip to content
48 changes: 42 additions & 6 deletions init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -145,8 +145,8 @@ vim.opt.splitbelow = true
-- Sets how neovim will display certain whitespace characters in the editor.
-- See `:help 'list'`
-- and `:help 'listchars'`
vim.opt.list = true
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
-- vim.opt.list = true
-- vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }

-- Preview substitutions live, as you type!
vim.opt.inccommand = 'split'
Expand All @@ -157,6 +157,10 @@ vim.opt.cursorline = true
-- Minimal number of screen lines to keep above and below the cursor.
vim.opt.scrolloff = 10

-- Tabstop and shiftwidth settings
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4

-- [[ Basic Keymaps ]]
-- See `:help vim.keymap.set()`

Expand All @@ -165,6 +169,9 @@ vim.opt.scrolloff = 10
vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')

-- Diagnostic keymaps
vim.keymap.set('n', '<leader>dp', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
vim.keymap.set('n', '<leader>dn', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })

-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
Expand All @@ -190,6 +197,9 @@ 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' })

-- Bind § to <Esc> in insert mode
vim.keymap.set('i', '§', '<Esc>')

-- [[ Basic Autocommands ]]
-- See `:help lua-guide-autocommands`

Expand Down Expand Up @@ -673,9 +683,9 @@ require('lazy').setup({
}
end,
},

{ -- Autoformat
'stevearc/conform.nvim',

event = { 'BufWritePre' },
cmd = { 'ConformInfo' },
keys = {
Expand Down Expand Up @@ -708,6 +718,7 @@ require('lazy').setup({
end,
formatters_by_ft = {
lua = { 'stylua' },
go = { 'golines' },
-- Conform can also run multiple formatters sequentially
-- python = { "isort", "black" },
--
Expand Down Expand Up @@ -838,13 +849,13 @@ require('lazy').setup({
-- change the command in the config to whatever the name of that colorscheme is.
--
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
'folke/tokyonight.nvim',
'rebelot/kanagawa.nvim',
priority = 1000, -- Make sure to load this before all the other start plugins.
init = function()
-- Load the colorscheme here.
-- Like many other themes, this one has different styles, and you could load
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
vim.cmd.colorscheme 'tokyonight-night'
vim.cmd.colorscheme 'kanagawa'

-- You can configure highlights by doing something like:
vim.cmd.hi 'Comment gui=none'
Expand Down Expand Up @@ -916,6 +927,15 @@ require('lazy').setup({
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
},
{
'sebdah/vim-delve',
},
{
'github/copilot.vim',
},
{
'tpope/vim-fugitive',
},

-- The following 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
Expand Down Expand Up @@ -965,5 +985,21 @@ require('lazy').setup({
},
})

require('conform').formatters.golines = {
prepend_args = { '--max-len=128 --no-reformat-tags' },
}

require('lspconfig').pylsp.setup {
settings = {
pylsp = {
plugins = {
pycodestyle = {
maxLineLength = 100,
},
},
},
},
}

-- The line beneath this is called `modeline`. See `:help modeline`
-- vim: ts=2 sts=2 sw=2 et
Loading