@@ -34,7 +34,7 @@ What is Kickstart?
3434
3535 If you don't know anything about Lua, I recommend taking some time to read through
3636 a guide. One possible example which will only take 10-15 minutes:
37- - https://learnxinyminutes.com/docs/lua/
37+ - https://learnxinyminutes.com/docs/lua/ini
3838
3939 After understanding a bit more about Lua, you can use `:help lua-guide` as a
4040 reference for how Neovim integrates Lua.
@@ -91,7 +91,7 @@ vim.g.mapleader = ' '
9191vim .g .maplocalleader = ' '
9292
9393-- Set to true if you have a Nerd Font installed and selected in the terminal
94- vim .g .have_nerd_font = false
94+ vim .g .have_nerd_font = true
9595
9696-- [[ Setting options ]]
9797-- See `:help vim.opt`
@@ -155,7 +155,7 @@ vim.opt.inccommand = 'split'
155155vim .opt .cursorline = true
156156
157157-- Minimal number of screen lines to keep above and below the cursor.
158- vim .opt .scrolloff = 10
158+ vim .opt .scrolloff = 20
159159
160160-- [[ Basic Keymaps ]]
161161-- See `:help vim.keymap.set()`
@@ -204,6 +204,20 @@ vim.api.nvim_create_autocmd('TextYankPost', {
204204 end ,
205205})
206206
207+ -- WARN: My Configuration
208+
209+ -- vim.opt.fillchars = { fold = ' ' }
210+ -- vim.opt.foldmethod = 'indent'
211+ -- vim.opt.foldenable = false
212+ -- vim.opt.foldlevel = 99
213+ -- g.markdown_folding = 1 -- enable markdown folding
214+
215+ vim .keymap .set (' n' , ' <space><space>x' , ' <cmd>source %<CR>' )
216+ vim .keymap .set (' n' , ' <space>x' , ' :.lua<CR>' )
217+ vim .keymap .set (' v' , ' <space>x' , ' :lua<CR>' )
218+
219+ -- WARN: My Configuration
220+
207221-- [[ Install `lazy.nvim` plugin manager ]]
208222-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
209223local lazypath = vim .fn .stdpath ' data' .. ' /lazy/lazy.nvim'
@@ -247,12 +261,84 @@ require('lazy').setup({
247261 ' lewis6991/gitsigns.nvim' ,
248262 opts = {
249263 signs = {
250- add = { text = ' +' },
251- change = { text = ' ~' },
264+ add = { text = ' ┃' },
265+ change = { text = ' ┃' },
266+ delete = { text = ' _' },
267+ topdelete = { text = ' ‾' },
268+ changedelete = { text = ' ~' },
269+ untracked = { text = ' ┆' },
270+ },
271+ signs_staged = {
272+ add = { text = ' ┃' },
273+ change = { text = ' ┃' },
252274 delete = { text = ' _' },
253275 topdelete = { text = ' ‾' },
254276 changedelete = { text = ' ~' },
277+ untracked = { text = ' ┆' },
255278 },
279+ signs_staged_enable = true ,
280+ on_attach = function (bufnr )
281+ local gitsigns = require ' gitsigns'
282+
283+ local function map (mode , l , r , opts )
284+ opts = opts or {}
285+ opts .buffer = bufnr
286+ vim .keymap .set (mode , l , r , opts )
287+ end
288+
289+ -- Navigation
290+ map (' n' , ' ]c' , function ()
291+ if vim .wo .diff then
292+ vim .cmd .normal { ' ]c' , bang = true }
293+ else
294+ gitsigns .nav_hunk ' next'
295+ end
296+ end )
297+
298+ map (' n' , ' [c' , function ()
299+ if vim .wo .diff then
300+ vim .cmd .normal { ' [c' , bang = true }
301+ else
302+ gitsigns .nav_hunk ' prev'
303+ end
304+ end )
305+
306+ -- Keybinds
307+ map (' n' , ' <leader>hp' , gitsigns .preview_hunk )
308+
309+ vim .cmd [[
310+ highlight GitSignsAdd guifg=green guibg=NONE
311+ highlight GitSignsChange guifg=darkyellow guibg=NONE
312+ highlight GitSignsDelete guifg=red guibg=NONE
313+ ]]
314+
315+ --[[
316+ -- Actions
317+ map('n', '<leader>hs', gitsigns.stage_hunk)
318+ map('n', '<leader>hr', gitsigns.reset_hunk)
319+ map('v', '<leader>hs', function()
320+ gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
321+ end)
322+ map('v', '<leader>hr', function()
323+ gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
324+ end)
325+ map('n', '<leader>hS', gitsigns.stage_buffer)
326+ map('n', '<leader>hu', gitsigns.undo_stage_hunk)
327+ map('n', '<leader>hR', gitsigns.reset_buffer)
328+ map('n', '<leader>hb', function()
329+ gitsigns.blame_line { full = true }
330+ end)
331+ map('n', '<leader>tb', gitsigns.toggle_current_line_blame)
332+ map('n', '<leader>hd', gitsigns.diffthis)
333+ map('n', '<leader>hD', function()
334+ gitsigns.diffthis '~'
335+ end)
336+ map('n', '<leader>td', gitsigns.toggle_deleted)
337+
338+ -- Text object
339+ map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
340+ --]]
341+ end ,
256342 },
257343 },
258344
@@ -937,7 +1023,7 @@ require('lazy').setup({
9371023 -- This is the easiest way to modularize your config.
9381024 --
9391025 -- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
940- -- { import = 'custom.plugins' },
1026+ { import = ' custom.plugins' },
9411027 --
9421028 -- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
9431029 -- Or use telescope!
0 commit comments