diff --git a/.gitignore b/.gitignore
index 68486fc3d35..bfc720f63cc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,6 +9,6 @@ spell/
# lazy-lock.json in version control - see https://lazy.folke.io/usage/lockfile
# For the official `nvim-lua/kickstart.nvim` git repository, we leave it ignored to avoid unneeded
# merge conflicts.
-lazy-lock.json
+# lazy-lock.json
.DS_Store
diff --git a/README.md b/README.md
index 093e42a6dd9..e127e8d37ff 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,14 @@
-# kickstart.nvim
+# kickstart-modular.nvim
## Introduction
+*This is a fork of [nvim-lua/kickstart.nvim](https://github.com/nvim-lua/kickstart.nvim) that moves from a single file to a multi file configuration.*
+
A starting point for Neovim that is:
* Small
-* Single-file
-* Completely Documented
+* Documented
+* Modular
**NOT** a Neovim distribution, but instead a starting point for your configuration.
@@ -82,7 +84,7 @@ too - it's ignored in the kickstart repo to make maintenance easier, but it's
Linux and Mac
```sh
-git clone https://github.com/nvim-lua/kickstart.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
+git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
```
@@ -123,7 +125,6 @@ examples of adding popularly requested plugins.
> [!NOTE]
> For more information about a particular plugin check its repository's documentation.
-
### Getting Started
[The Only Video You Need to Get Started with Neovim](https://youtu.be/m8C0Cq9Uv9o)
@@ -154,12 +155,6 @@ examples of adding popularly requested plugins.
into smaller parts. A fork of kickstart that does this while maintaining the
same functionality is available here:
* [kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim)
- * Discussions on this topic can be found here:
- * [Restructure the configuration](https://github.com/nvim-lua/kickstart.nvim/issues/218)
- * [Reorganize init.lua into a multi-file setup](https://github.com/nvim-lua/kickstart.nvim/pull/473)
-
-### Install Recipes
-
Below you can find OS specific install instructions for Neovim and dependencies.
After installing all the dependencies continue with the [Install Kickstart](#install-kickstart) step.
@@ -262,7 +257,7 @@ available methods being discussed
Bob
[Bob](https://github.com/MordechaiHadad/bob) is a Neovim version manager for
-all platforms. Simply install
+all plattforms. Simply install
[rustup](https://rust-lang.github.io/rustup/installation/other.html),
and run the following commands:
diff --git a/init.lua b/init.lua
index ed50b69d7f3..40366c44aca 100644
--- a/init.lua
+++ b/init.lua
@@ -1,97 +1,17 @@
---[[
-
-=====================================================================
-==================== READ THIS BEFORE CONTINUING ====================
-=====================================================================
-======== .-----. ========
-======== .----------------------. | === | ========
-======== |.-""""""""""""""""""-.| |-----| ========
-======== || || | === | ========
-======== || KICKSTART.NVIM || |-----| ========
-======== || || | === | ========
-======== || || |-----| ========
-======== ||:Tutor || |:::::| ========
-======== |'-..................-'| |____o| ========
-======== `"")----------------(""` ___________ ========
-======== /::::::::::| |::::::::::\ \ no mouse \ ========
-======== /:::========| |==hjkl==:::\ \ required \ ========
-======== '""""""""""""' '""""""""""""' '""""""""""' ========
-======== ========
-=====================================================================
-=====================================================================
-
-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:
- - https://learnxinyminutes.com/docs/lua/
-
- After understanding a bit more about Lua, you can use `:help lua-guide` as a
- reference for how Neovim integrates Lua.
- - :help lua-guide
- - (or HTML version): https://neovim.io/doc/user/lua-guide.html
-
-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
- about reading, navigating and searching the builtin help documentation.
-
- This should be the first place you go to look when you're stuck or confused
- with something. It's one of my favorite Neovim features.
-
- MOST IMPORTANTLY, we provide a keymap "sh" to [s]earch the [h]elp documentation,
- which is very useful when you're not exactly sure of what you're looking for.
-
- I have left several `:help X` comments throughout the init.lua
- These are hints about where to find more information about the relevant settings,
- plugins or Neovim features used in Kickstart.
-
- NOTE: Look for lines like this
-
- Throughout the file. These are for you, the reader, to help you 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 Neovim config.
-
-If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
-
-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 loaded (otherwise wrong leader will be used)
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed and selected in the terminal
-vim.g.have_nerd_font = false
+vim.g.have_nerd_font = true
+
+-- Configure lazy.nvim to use LuaJIT for rocks support
+vim.g.lazy_rocks = {
+ hererocks = {
+ lua_dir = '/usr/local/bin',
+ lua_version = '5.1',
+ },
+}
-- [[ Setting options ]]
-- See `:help vim.o`
@@ -102,7 +22,7 @@ vim.g.have_nerd_font = false
vim.o.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
--- vim.o.relativenumber = true
+vim.o.relativenumber = true
-- Enable mouse mode, can be useful for resizing splits for example!
vim.o.mouse = 'a'
@@ -244,15 +164,7 @@ local rtp = vim.opt.rtp
rtp:prepend(lazypath)
-- [[ Configure and install plugins ]]
---
--- To check the current status of your plugins, run
--- :Lazy
---
--- You can press `?` in this menu for help. Use `:q` to close the window
---
--- To update plugins you can run
--- :Lazy update
---
+
-- NOTE: Here is where you install your plugins.
require('lazy').setup({
-- NOTE: Plugins can be added via a link or github org/name. To run setup automatically, use `opts = {}`
@@ -273,21 +185,6 @@ require('lazy').setup({
-- options to `gitsigns.nvim`.
--
-- See `:help gitsigns` to understand what the configuration keys do
- { -- Adds git related signs to the gutter, as well as utilities for managing changes
- 'lewis6991/gitsigns.nvim',
- ---@module 'gitsigns'
- ---@type Gitsigns.Config
- ---@diagnostic disable-next-line: missing-fields
- opts = {
- signs = {
- add = { text = '+' }, ---@diagnostic disable-line: missing-fields
- change = { text = '~' }, ---@diagnostic disable-line: missing-fields
- delete = { text = '_' }, ---@diagnostic disable-line: missing-fields
- topdelete = { text = '‾' }, ---@diagnostic disable-line: missing-fields
- changedelete = { text = '~' }, ---@diagnostic disable-line: missing-fields
- },
- },
- },
-- NOTE: Plugins can also be configured to run Lua code when they are loaded.
--
@@ -302,6 +199,7 @@ require('lazy').setup({
--
-- Then, because we use the `opts` key (recommended), the configuration runs
-- after the plugin has been loaded as `require(MODULE).setup(opts)`.
+ require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
{ -- Useful plugin to show you pending keybinds.
'folke/which-key.nvim',
@@ -334,6 +232,7 @@ require('lazy').setup({
{ -- Fuzzy Finder (files, lsp, etc)
'nvim-telescope/telescope.nvim',
-- By default, Telescope is included and acts as your picker for everything.
+ -- Configure LSP (Language Server Protocol)
-- If you would like to switch to a different picker (like snacks, or fzf-lua)
-- you can disable the Telescope plugin by setting enabled to false and enable
@@ -387,13 +286,19 @@ require('lazy').setup({
require('telescope').setup {
-- You can put your default mappings / updates / etc. in here
-- All the info you're looking for is in `:help telescope.setup()`
- --
- -- defaults = {
- -- mappings = {
- -- i = { [''] = 'to_fuzzy_refine' },
- -- },
- -- },
- -- pickers = {}
+ defaults = {
+ file_ignore_patterns = { '%.git/', 'node_modules/', 'dist/', 'build/' },
+ },
+ pickers = {
+ find_files = {
+ no_ignore = true,
+ },
+ live_grep = {
+ additional_args = function()
+ return { '--no-ignore' }
+ end,
+ },
+ },
extensions = {
['ui-select'] = { require('telescope.themes').get_dropdown() },
},
@@ -598,20 +503,38 @@ require('lazy').setup({
-- Enable the following language servers
-- Feel free to add/remove any LSPs that you want here. They will automatically be installed.
-- See `:help lsp-config` for information about keys and how to configure
+ local util = require 'lspconfig.util'
+
+ local function root_dir_from_pattern(...)
+ local matcher = util.root_pattern(...)
+ return function(bufnr, on_dir)
+ local fname = vim.api.nvim_buf_get_name(bufnr)
+ local root = matcher(fname)
+ if root then on_dir(root) end
+ end
+ end
+
---@type table
local servers = {
-- clangd = {},
-- gopls = {},
-- pyright = {},
-- rust_analyzer = {},
- --
+ cssls = {},
-- Some languages (like typescript) have entire language plugins that can be useful:
-- https://github.com/pmizio/typescript-tools.nvim
--
-- But for many setups, the LSP (`ts_ls`) will work just fine
- -- ts_ls = {},
+ ts_ls = {
+ root_dir = root_dir_from_pattern('package.json', 'tsconfig.json', 'jsconfig.json'),
+ single_file_support = false,
+ },
- stylua = {}, -- Used to format Lua code
+ -- Use Deno's built-in language server when deno configuration files are present
+ denols = {
+ root_dir = root_dir_from_pattern('deno.json', 'deno.jsonc'),
+ single_file_support = false,
+ },
-- Special Lua Config, as recommended by neovim help docs
lua_ls = {
@@ -650,9 +573,13 @@ require('lazy').setup({
-- :Mason
--
-- You can press `g?` for help in this menu.
- local ensure_installed = vim.tbl_keys(servers or {})
+ local ensure_installed = {}
+ for server_name in pairs(servers or {}) do
+ if server_name ~= 'denols' then table.insert(ensure_installed, server_name) end
+ end
vim.list_extend(ensure_installed, {
-- You can add other tools here that you want Mason to install
+ 'stylua',
})
require('mason-tool-installer').setup { ensure_installed = ensure_installed }
@@ -910,17 +837,16 @@ require('lazy').setup({
-- 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.indent_line',
-- require 'kickstart.plugins.lint',
-- require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
- -- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommended keymaps
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config.
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
- -- { import = 'custom.plugins' },
+ { import = 'custom.plugins' },
--
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
-- Or use telescope!
diff --git a/lazy-lock.json b/lazy-lock.json
new file mode 100644
index 00000000000..65eb82c3e62
--- /dev/null
+++ b/lazy-lock.json
@@ -0,0 +1,25 @@
+{
+ "LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
+ "blink.cmp": { "branch": "main", "commit": "451168851e8e2466bc97ee3e026c3dcb9141ce07" },
+ "conform.nvim": { "branch": "master", "commit": "086a40dc7ed8242c03be9f47fbcee68699cc2395" },
+ "fidget.nvim": { "branch": "main", "commit": "7fa433a83118a70fe24c1ce88d5f0bd3453c0970" },
+ "gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
+ "guess-indent.nvim": { "branch": "main", "commit": "84a4987ff36798c2fc1169cbaff67960aed9776f" },
+ "indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
+ "lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
+ "lsp_lines.nvim": { "branch": "main", "commit": "a92c755f182b89ea91bd8a6a2227208026f27b4d" },
+ "mason-lspconfig.nvim": { "branch": "main", "commit": "a979821a975897b88493843301950c456a725982" },
+ "mason-tool-installer.nvim": { "branch": "main", "commit": "443f1ef8b5e6bf47045cb2217b6f748a223cf7dc" },
+ "mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
+ "mini.nvim": { "branch": "main", "commit": "59f09943573c5348ca6c88393fa09ce3b66a7818" },
+ "nvim-lspconfig": { "branch": "master", "commit": "841c6d4139aedb8a3f2baf30cef5327371385b93" },
+ "nvim-treesitter": { "branch": "main", "commit": "875515255192864c33981c3ed66ad94e561b904a" },
+ "nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
+ "plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
+ "telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
+ "telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
+ "telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" },
+ "todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
+ "tokyonight.nvim": { "branch": "main", "commit": "5da1b76e64daf4c5d410f06bcb6b9cb640da7dfd" },
+ "which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
+}
diff --git a/lua/custom/plugins/float-terminal.lua b/lua/custom/plugins/float-terminal.lua
new file mode 100644
index 00000000000..bb76b230384
--- /dev/null
+++ b/lua/custom/plugins/float-terminal.lua
@@ -0,0 +1,59 @@
+vim.keymap.set('t', '', '')
+
+local state = {
+ floating = {
+ buf = -1,
+ win = -1,
+ },
+}
+
+local function create_floating_window(opts)
+ opts = opts or {}
+ local width = opts.width or math.floor(vim.o.columns * 0.8)
+ local height = opts.height or math.floor(vim.o.lines * 0.8)
+
+ -- Calculate the position to center the window
+ local col = math.floor((vim.o.columns - width) / 2)
+ local row = math.floor((vim.o.lines - height) / 2)
+
+ -- Create a buffer
+ local buf = nil
+ if vim.api.nvim_buf_is_valid(opts.buf) then
+ buf = opts.buf
+ else
+ buf = vim.api.nvim_create_buf(false, true) -- No file, scratch buffer
+ end
+
+ -- Define window configuration
+ local win_config = {
+ relative = 'editor',
+ width = width,
+ height = height,
+ col = col,
+ row = row,
+ style = 'minimal', -- No borders or extra UI elements
+ border = 'rounded',
+ }
+
+ -- Create the floating window
+ local win = vim.api.nvim_open_win(buf, true, win_config)
+
+ return { buf = buf, win = win }
+end
+
+local toggle_terminal = function()
+ if not vim.api.nvim_win_is_valid(state.floating.win) then
+ state.floating = create_floating_window { buf = state.floating.buf }
+ if vim.bo[state.floating.buf].buftype ~= 'terminal' then
+ vim.cmd.terminal()
+ end
+ else
+ vim.api.nvim_win_hide(state.floating.win)
+ end
+end
+vim.keymap.set({ 't', 'n' }, 'tt', toggle_terminal)
+
+-- Example usage:
+-- Create a floating window with default dimensions
+vim.api.nvim_create_user_command('Floaterminal', toggle_terminal, {})
+return {}
diff --git a/lua/custom/plugins/init.lua b/lua/custom/plugins/init.lua
index b3ddcfdd3aa..3ece8cc3f46 100644
--- a/lua/custom/plugins/init.lua
+++ b/lua/custom/plugins/init.lua
@@ -5,4 +5,34 @@
---@module 'lazy'
---@type LazySpec
+vim.g.netrw_banner = '0' -- disable topbar
+-- vim.g.netrw_browse_split = 4 -- open in prior buffer/window
+-- -- vim.g.netrw_altv = 1 -- open fle splits to the right
+vim.g.netrw_liststyle = 3 -- tree view
+
+vim.wo.foldmethod = 'expr'
+-- vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
+-- vim.wo.foldenable = false
+vim.wo[0][0].foldexpr = 'v:lua.vim.treesitter.foldexpr()'
+vim.wo[0][0].foldmethod = 'expr'
+
+-- copy current buffer path to "+
+vim.keymap.set('n', 'yb', 'let @+ = expand("%")', { desc = 'yank to plus register current relative path' })
+
+-- https://devpad.net/blog/upgrading-nvim-v010-to-v011
+vim.opt.completeopt = { 'menuone', 'fuzzy', 'noinsert', 'preview' }
+vim.o.omnifunc = 'v:lua.vim.lsp.omnifunc'
+
+-- never use tabs
+vim.o.expandtab = true
+-- evitar folds
+vim.o.foldlevelstart = 99
+
+local set = vim.opt_local
+set.shiftwidth = 2
+vim.o.shiftwidth = 2
+
+--
+vim.cmd "set statusline+=%{get(b:,'gitsigns_status','')}"
+
return {}
diff --git a/lua/custom/plugins/lsp-lines.lua b/lua/custom/plugins/lsp-lines.lua
new file mode 100644
index 00000000000..3bbd306f951
--- /dev/null
+++ b/lua/custom/plugins/lsp-lines.lua
@@ -0,0 +1,6 @@
+return {
+ 'https://git.sr.ht/~whynothugo/lsp_lines.nvim',
+ config = function()
+ require('lsp_lines').setup()
+ end,
+}
diff --git a/lua/kickstart/plugins/gitsigns.lua b/lua/kickstart/plugins/gitsigns.lua
index 5f5652f9249..6283887dc7e 100644
--- a/lua/kickstart/plugins/gitsigns.lua
+++ b/lua/kickstart/plugins/gitsigns.lua
@@ -1,58 +1,75 @@
--- Adds git related signs to the gutter, as well as utilities for managing changes
--- NOTE: gitsigns is already included in init.lua but contains only the base
--- config. This will add also the recommended keymaps.
-
----@module 'lazy'
----@type LazySpec
+-- Alternatively, use `config = function() ... end` for full control over the configuration.
+-- If you prefer to call `setup` explicitly, use:
+-- {
+-- 'lewis6991/gitsigns.nvim',
+-- config = function()
+-- require('gitsigns').setup({
+-- -- Your gitsigns configuration here
+-- })
+-- end,
+-- }
+--
+-- Here is a more advanced example where we pass configuration
+-- options to `gitsigns.nvim`.
+--
+-- See `:help gitsigns` to understand what the configuration keys do
return {
- 'lewis6991/gitsigns.nvim',
- ---@module 'gitsigns'
- ---@type Gitsigns.Config
- ---@diagnostic disable-next-line: missing-fields
- opts = {
- on_attach = function(bufnr)
- local gitsigns = require 'gitsigns'
-
- local function map(mode, l, r, opts)
- opts = opts or {}
- opts.buffer = bufnr
- vim.keymap.set(mode, l, r, opts)
- end
+ { -- Adds git related signs to the gutter, as well as utilities for managing changes
+ 'lewis6991/gitsigns.nvim',
+ opts = {
+ signs = {
+ add = { text = '+' },
+ change = { text = '~' },
+ delete = { text = '_' },
+ topdelete = { text = '‾' },
+ changedelete = { text = '~' },
+ },
+ current_line_blame = true,
+ on_attach = function(bufnr)
+ local gitsigns = require 'gitsigns'
- -- Navigation
- map('n', ']c', function()
- if vim.wo.diff then
- vim.cmd.normal { ']c', bang = true }
- else
- gitsigns.nav_hunk 'next'
+ local function map(mode, l, r, opts)
+ opts = opts or {}
+ opts.buffer = bufnr
+ vim.keymap.set(mode, l, r, opts)
end
- end, { desc = 'Jump to next git [c]hange' })
- map('n', '[c', function()
- if vim.wo.diff then
- vim.cmd.normal { '[c', bang = true }
- else
- gitsigns.nav_hunk 'prev'
- end
- end, { desc = 'Jump to previous git [c]hange' })
+ -- Navigation
+ map('n', ']c', function()
+ if vim.wo.diff then
+ vim.cmd.normal { ']c', bang = true }
+ else
+ gitsigns.nav_hunk 'next'
+ end
+ end, { desc = 'Jump to next git [c]hange' })
+
+ map('n', '[c', function()
+ if vim.wo.diff then
+ vim.cmd.normal { '[c', bang = true }
+ else
+ gitsigns.nav_hunk 'prev'
+ end
+ end, { desc = 'Jump to previous git [c]hange' })
- -- Actions
- -- visual mode
- map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
- map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
- -- normal mode
- map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
- map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
- map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
- map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
- map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
- map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
- map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
- map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
- map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
- -- Toggles
- map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
- map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
- end,
+ -- Actions
+ -- visual mode
+ map('v', 'hs', function() gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [s]tage hunk' })
+ map('v', 'hr', function() gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } end, { desc = 'git [r]eset hunk' })
+ -- normal mode
+ map('n', 'hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
+ map('n', 'hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
+ map('n', 'hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
+ map('n', 'hu', gitsigns.stage_hunk, { desc = 'git [u]ndo stage hunk' })
+ map('n', 'hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
+ map('n', 'hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
+ map('n', 'hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
+ map('n', 'hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
+ map('n', 'hD', function() gitsigns.diffthis '@' end, { desc = 'git [D]iff against last commit' })
+ -- Toggles
+ map('n', 'tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
+ map('n', 'tD', gitsigns.preview_hunk_inline, { desc = '[T]oggle git show [D]eleted' })
+ end,
+ },
},
}
+-- vim: ts=2 sts=2 sw=2 et
diff --git a/session.vim b/session.vim
new file mode 100644
index 00000000000..d5514e631ec
--- /dev/null
+++ b/session.vim
@@ -0,0 +1,64 @@
+let SessionLoad = 1
+let s:so_save = &g:so | let s:siso_save = &g:siso | setg so=0 siso=0 | setl so=-1 siso=-1
+let v:this_session=expand(":p")
+silent only
+silent tabonly
+cd ~/.config/nvim
+if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == ''
+ let s:wipebuf = bufnr('%')
+endif
+let s:shortmess_save = &shortmess
+if &shortmess =~ 'A'
+ set shortmess=aoOA
+else
+ set shortmess=aoO
+endif
+badd +20 lua/kickstart/plugins/conform.lua
+badd +5 lua/kickstart/plugins/treesitter.lua
+badd +1 init.lua
+badd +37 lua/lazy-plugins.lua
+badd +127 lua/kickstart/plugins/lspconfig.lua
+argglobal
+%argdel
+edit lua/kickstart/plugins/lspconfig.lua
+wincmd t
+let s:save_winminheight = &winminheight
+let s:save_winminwidth = &winminwidth
+set winminheight=0
+set winheight=1
+set winminwidth=0
+set winwidth=1
+argglobal
+balt lua/kickstart/plugins/treesitter.lua
+setlocal foldmethod=expr
+setlocal foldexpr=v:lua.vim.treesitter.foldexpr()
+setlocal foldmarker={{{,}}}
+setlocal foldignore=#
+setlocal foldlevel=99
+setlocal foldminlines=1
+setlocal foldnestmax=20
+setlocal foldenable
+let s:l = 127 - ((11 * winheight(0) + 20) / 40)
+if s:l < 1 | let s:l = 1 | endif
+keepjumps exe s:l
+normal! zt
+keepjumps 127
+normal! 034|
+tabnext 1
+if exists('s:wipebuf') && len(win_findbuf(s:wipebuf)) == 0 && getbufvar(s:wipebuf, '&buftype') isnot# 'terminal'
+ silent exe 'bwipe ' . s:wipebuf
+endif
+unlet! s:wipebuf
+set winheight=1 winwidth=20
+let &shortmess = s:shortmess_save
+let &winminheight = s:save_winminheight
+let &winminwidth = s:save_winminwidth
+let s:sx = expand(":p:r")."x.vim"
+if filereadable(s:sx)
+ exe "source " . fnameescape(s:sx)
+endif
+let &g:so = s:so_save | let &g:siso = s:siso_save
+set hlsearch
+doautoall SessionLoadPost
+unlet SessionLoad
+" vim: set ft=vim :