From b365948225600b1fcf94efe80f439fbbbc903701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20I=C3=AAdo?= Date: Sat, 26 Aug 2023 12:09:32 -0300 Subject: [PATCH] map c-w -> s && scroll to scroll+zz --- init.lua | 232 +++++++++++++++++++++++-------------------------------- 1 file changed, 96 insertions(+), 136 deletions(-) diff --git a/init.lua b/init.lua index ad993ea7..40465dc5 100644 --- a/init.lua +++ b/init.lua @@ -1,49 +1,6 @@ ---[[ - -===================================================================== -==================== READ THIS BEFORE CONTINUING ==================== -===================================================================== - -Kickstart.nvim is *not* a distribution. - -Kickstart.nvim is a template 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 should start exploring, configuring and tinkering to - explore Neovim! - - If you don't know anything about Lua, I recommend taking some time to read through - a guide. One possible example: - - https://learnxinyminutes.com/docs/lua/ - - - And then you can explore or search through `:help lua-guide` - - https://neovim.io/doc/user/lua-guide.html - - -Kickstart Guide: - -I have left several `:help X` comments throughout the init.lua -You should run that command and read that help section for more information. - -In addition, I have some `NOTE:` items throughout the file. -These are for you, the reader to help understand what is happening. Feel free to delete -them once you know what you're doing, but they should serve as a guide for when you -are first encountering a few different constructs in your nvim config. - -I hope you enjoy your Neovim journey, -- TJ - -P.S. You can delete this when you're done too. It's your config now :) ---]] --- Set as the leader key --- See `:help mapleader` --- NOTE: Must happen before plugins are required (otherwise wrong leader will be used) vim.g.mapleader = ' ' vim.g.maplocalleader = ' ' --- Install package manager -- https://github.com/folke/lazy.nvim -- `:help lazy.nvim.txt` for more info local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim' @@ -143,122 +100,125 @@ require('lazy').setup({ { -- Set lualine as statusline 'nvim-lualine/lualine.nvim', - -- See `:help lualine.txt` - opts = { - options = { - icons_enabled = false, - theme = 'onedark', - component_separators = '|', - section_separators = '', + -- See `:help lualine.txt` + opts = { + options = { + icons_enabled = false, + theme = 'onedark', + component_separators = '|', + section_separators = '', + }, }, }, - }, - { - -- Add indentation guides even on blank lines - 'lukas-reineke/indent-blankline.nvim', - -- Enable `lukas-reineke/indent-blankline.nvim` - -- See `:help indent_blankline.txt` - opts = { - char = '┊', - show_trailing_blankline_indent = false, - }, - }, - - -- "gc" to comment visual regions/lines - { 'numToStr/Comment.nvim', opts = {} }, - - -- Fuzzy Finder (files, lsp, etc) - { - 'nvim-telescope/telescope.nvim', - branch = '0.1.x', - dependencies = { - 'nvim-lua/plenary.nvim', - -- Fuzzy Finder Algorithm which requires local dependencies to be built. - -- Only load if `make` is available. Make sure you have the system - -- requirements installed. - { - 'nvim-telescope/telescope-fzf-native.nvim', - -- NOTE: If you are having trouble with this installation, - -- refer to the README for telescope-fzf-native for more instructions. - build = 'make', - cond = function() - return vim.fn.executable 'make' == 1 - end, + { + -- Add indentation guides even on blank lines + 'lukas-reineke/indent-blankline.nvim', + -- Enable `lukas-reineke/indent-blankline.nvim` + -- See `:help indent_blankline.txt` + opts = { + char = '┊', + show_trailing_blankline_indent = false, }, }, - }, - { - -- Highlight, edit, and navigate code - 'nvim-treesitter/nvim-treesitter', - dependencies = { - 'nvim-treesitter/nvim-treesitter-textobjects', + -- "gc" to comment visual regions/lines + { 'numToStr/Comment.nvim', opts = {} }, + + -- Fuzzy Finder (files, lsp, etc) + { + 'nvim-telescope/telescope.nvim', + branch = '0.1.x', + dependencies = { + 'nvim-lua/plenary.nvim', + -- Fuzzy Finder Algorithm which requires local dependencies to be built. + -- Only load if `make` is available. Make sure you have the system + -- requirements installed. + { + 'nvim-telescope/telescope-fzf-native.nvim', + -- NOTE: If you are having trouble with this installation, + -- refer to the README for telescope-fzf-native for more instructions. + build = 'make', + cond = function() + return vim.fn.executable 'make' == 1 + end, + }, + }, }, - build = ':TSUpdate', - }, - -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart - -- These are some example plugins that I've included in the kickstart repository. - -- Uncomment any of the lines below to enable them. - -- require 'kickstart.plugins.autoformat', - -- require 'kickstart.plugins.debug', + { + -- Highlight, edit, and navigate code + 'nvim-treesitter/nvim-treesitter', + dependencies = { + 'nvim-treesitter/nvim-treesitter-textobjects', + }, + build = ':TSUpdate', + }, - -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` - -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping - -- up-to-date with whatever is in the kickstart repo. - -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. - -- - -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins - -- { import = 'custom.plugins' }, -}, {}) + -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart + -- These are some example plugins that I've included in the kickstart repository. + -- Uncomment any of the lines below to enable them. + -- require 'kickstart.plugins.autoformat', + -- require 'kickstart.plugins.debug', --- [[ Setting options ]] --- See `:help vim.o` --- NOTE: You can change these options as you wish! + -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` + -- You can use this folder to prevent any conflicts with this init.lua if you're interested in keeping + -- up-to-date with whatever is in the kickstart repo. + -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going. + -- + -- For additional information see: https://github.com/folke/lazy.nvim#-structuring-your-plugins + -- { import = 'custom.plugins' }, + }, {}) --- Set highlight on search -vim.o.hlsearch = false + -- [[ Setting options ]] + -- See `:help vim.o` + -- NOTE: You can change these options as you wish! --- Make line numbers default -vim.wo.number = true + -- Set highlight on search + vim.o.hlsearch = false --- Enable mouse mode -vim.o.mouse = 'a' + -- Make line numbers default + vim.wo.number = true --- Sync clipboard between OS and Neovim. --- Remove this option if you want your OS clipboard to remain independent. --- See `:help 'clipboard'` -vim.o.clipboard = 'unnamedplus' + -- Enable mouse mode + vim.o.mouse = 'a' --- Enable break indent -vim.o.breakindent = true + -- Sync clipboard between OS and Neovim. + -- Remove this option if you want your OS clipboard to remain independent. + -- See `:help 'clipboard'` + vim.o.clipboard = 'unnamedplus' --- Save undo history -vim.o.undofile = true + -- Enable break indent + vim.o.breakindent = true --- Case-insensitive searching UNLESS \C or capital in search -vim.o.ignorecase = true -vim.o.smartcase = true + -- Save undo history + vim.o.undofile = true --- Keep signcolumn on by default -vim.wo.signcolumn = 'yes' + -- Case-insensitive searching UNLESS \C or capital in search + vim.o.ignorecase = true + vim.o.smartcase = true --- Decrease update time -vim.o.updatetime = 250 -vim.o.timeoutlen = 300 + -- Keep signcolumn on by default + vim.wo.signcolumn = 'yes' --- Set completeopt to have a better completion experience -vim.o.completeopt = 'menuone,noselect' + -- Decrease update time + vim.o.updatetime = 250 + vim.o.timeoutlen = 300 --- NOTE: You should make sure your terminal supports this -vim.o.termguicolors = true + -- Set completeopt to have a better completion experience + vim.o.completeopt = 'menuone,noselect' --- [[ Basic Keymaps ]] + -- NOTE: You should make sure your terminal supports this + vim.o.termguicolors = true --- Keymaps for better default experience --- See `:help vim.keymap.set()` -vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + -- [[ Basic Keymaps ]] + + -- Keymaps for better default experience + -- See `:help vim.keymap.set()` + vim.keymap.set({ 'n', 'v' }, '', '', { silent = true }) + vim.keymap.set({ 'n', 'v' }, '','zz') + vim.keymap.set({ 'n', 'v' }, '','zz') + vim.keymap.set({ 'n', 'v' }, 's', '') -- Remap for dealing with word wrap vim.keymap.set('n', 'k', "v:count == 0 ? 'gk' : 'k'", { expr = true, silent = true })