diff --git a/init.lua b/init.lua index b08e67ff..fc1bb2b6 100644 --- a/init.lua +++ b/init.lua @@ -24,13 +24,6 @@ What is Kickstart? Kickstart.nvim is *not* a distribution. - Kickstart.nvim is a starting point for your own configuration. - The goal is that you can read every line of code, top-to-bottom, understand - what your configuration is doing, and modify it to suit your needs. - - Once you've done that, you can start exploring, configuring and tinkering to - make Neovim your own! That might mean leaving Kickstart just the way it is for a while - or immediately breaking it into modular pieces. It's up to you! If you don't know anything about Lua, I recommend taking some time to read through a guide. One possible example which will only take 10-15 minutes: @@ -43,18 +36,6 @@ What is Kickstart? Kickstart Guide: - TODO: The very first thing you should do is to run the command `:Tutor` in Neovim. - - If you don't know what this means, type the following: - - - - : - - Tutor - - - - (If you already know the Neovim basics, you can skip this step.) - - Once you've completed that, you can continue working through **AND READING** the rest - of the kickstart init.lua. Next, run AND READ `:help`. This will open up a help window with some basic information @@ -155,9 +136,9 @@ vim.opt.inccommand = 'split' vim.opt.cursorline = true -- Minimal number of screen lines to keep above and below the cursor. -vim.opt.scrolloff = 10 +vim.opt.scrolloff = 3 --- Restore cursor position form last file open +-- Restore cursor position from last file open vim.api.nvim_create_autocmd('BufRead', { callback = function(opts) vim.api.nvim_create_autocmd('BufWinEnter', { @@ -174,41 +155,6 @@ vim.api.nvim_create_autocmd('BufRead', { end, }) --- [[ Basic Keymaps ]] --- See `:help vim.keymap.set()` - --- Clear highlights on search when pressing in normal mode --- See `:help hlsearch` -vim.keymap.set('n', '', 'nohlsearch') - --- Diagnostic keymaps -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 --- for people to discover. Otherwise, you normally need to press , which --- is not what someone will guess without a bit more experience. --- --- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping --- or just use to exit terminal mode -vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }) - --- Keybinds to make split navigation easier. --- Use CTRL+ to switch between windows --- --- See `:help wincmd` for a list of all window commands -vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }) -vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }) -vim.keymap.set('n', '', ':bn!', { desc = 'Go to next buffer' }) -vim.keymap.set('n', '', ':bp!', { desc = 'Go to previous buffer' }) - --- Toggles -vim.keymap.set('n', 'n', ':set number!:set relativenumber!') -vim.keymap.set('n', 'g', ':Gitsigns toggle_signs', { desc = 'Toggle Gitsigns' }) -vim.keymap.set('n', 'l', ':set list!', { desc = 'Toggle list mode' }) -vim.keymap.set('n', 'p', ':set paste!', { desc = 'Toggle paste mode' }) - -- [[ Basic Autocommands ]] -- See `:help lua-guide-autocommands` @@ -914,22 +860,29 @@ require('lazy').setup({ -- Simple and easy statusline. -- You could remove this setup call if you don't like it, -- and try some other statusline plugin - local statusline = require 'mini.statusline' + --local statusline = require 'mini.statusline' -- set use_icons to true if you have a Nerd Font - statusline.setup { use_icons = vim.g.have_nerd_font } + --statusline.setup { use_icons = vim.g.have_nerd_font } -- You can configure sections in the statusline by overriding their -- default behavior. For example, here we set the section for -- cursor location to LINE:COLUMN ---@diagnostic disable-next-line: duplicate-set-field - statusline.section_location = function() - return '%2l:%-2v' - end + --statusline.section_location = function() + -- return '%2l:%-2v' + --end -- ... and there is more! -- Check out: https://github.com/echasnovski/mini.nvim end, }, + { + 'nvim-lualine/lualine.nvim', + dependencies = { 'nvim-tree/nvim-web-devicons' }, + config = function() + require('lualine').setup() + end, + }, { -- Highlight, edit, and navigate code 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate', @@ -956,10 +909,6 @@ require('lazy').setup({ -- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects }, - -- 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 - -- place them in the correct locations. - -- NOTE: Next step on your Neovim journey: Add/Configure additional plugins for Kickstart -- -- Here are some example plugins that I've included in the Kickstart repository. diff --git a/lua/custom/plugins/keymaps.lua b/lua/custom/plugins/keymaps.lua new file mode 100644 index 00000000..53d5ce69 --- /dev/null +++ b/lua/custom/plugins/keymaps.lua @@ -0,0 +1,42 @@ +return { + -- [[ Basic Keymaps ]] + -- See `:help vim.keymap.set()` + + -- Clear highlights on search when pressing in normal mode + -- See `:help hlsearch` + vim.keymap.set('n', '', 'nohlsearch'), + + -- Diagnostic keymaps + 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 + -- for people to discover. Otherwise, you normally need to press , which + -- is not what someone will guess without a bit more experience. + -- + -- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping + -- or just use to exit terminal mode + vim.keymap.set('t', '', '', { desc = 'Exit terminal mode' }), + + -- Keybinds to make split navigation easier. + -- Use CTRL+ to switch between windows + -- + -- See `:help wincmd` for a list of all window commands + vim.keymap.set('n', '', '', { desc = 'Move focus to the left window' }), + vim.keymap.set('n', '', '', { desc = 'Move focus to the right window' }), + vim.keymap.set('n', '', '', { desc = 'Move focus to the lower window' }), + vim.keymap.set('n', '', '', { desc = 'Move focus to the upper window' }), + vim.keymap.set('n', '', ':bn!', { desc = 'Go to next buffer' }), + vim.keymap.set('n', '', ':bp!', { desc = 'Go to previous buffer' }), + + -- terraform + vim.keymap.set('n', 'ti', ':!terraform init', { desc = 'terraform init' }), + vim.keymap.set('n', 'tv', ':!terraform validate', { desc = 'terraform validate' }), + vim.keymap.set('n', 'tp', ':!terraform plan', { desc = 'terraform plan' }), + vim.keymap.set('n', 'taa', ':!terraform apply -auto-approve', { desc = 'terraform apply' }), + + -- Toggles + vim.keymap.set('n', 'n', ':set number!:set relativenumber!'), + vim.keymap.set('n', 'g', ':Gitsigns toggle_signs', { desc = 'Toggle Gitsigns' }), + vim.keymap.set('n', 'l', ':set list!', { desc = 'Toggle list mode' }), + vim.keymap.set('n', 'p', ':set paste!', { desc = 'Toggle paste mode' }), +}