diff --git a/init.lua b/init.lua index ee8fbc992e1..1cdaff147c3 100644 --- a/init.lua +++ b/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' @@ -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' @@ -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()` @@ -165,6 +169,9 @@ vim.opt.scrolloff = 10 vim.keymap.set('n', '', 'nohlsearch') -- Diagnostic keymaps +vim.keymap.set('n', 'dp', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' }) +vim.keymap.set('n', 'dn', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' }) +vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' }) vim.keymap.set('n', '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 @@ -190,6 +197,9 @@ vim.keymap.set('n', '', '', { desc = 'Move focus to the right win vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) +-- Bind § to in insert mode +vim.keymap.set('i', '§', '') + -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -673,9 +683,9 @@ require('lazy').setup({ } end, }, - { -- Autoformat 'stevearc/conform.nvim', + event = { 'BufWritePre' }, cmd = { 'ConformInfo' }, keys = { @@ -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" }, -- @@ -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' @@ -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 @@ -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