189 lines
7.3 KiB
Lua
189 lines
7.3 KiB
Lua
--[[
|
|
|
|
=====================================================================
|
|
=====================================================================
|
|
======== .-----. ========
|
|
======== .----------------------. | === | ========
|
|
======== |.-""""""""""""""""""-.| |-----| ========
|
|
======== || || | === | ========
|
|
======== || Judokasarin.NVIM || |-----| ========
|
|
======== || || | === | ========
|
|
======== || || |-----| ========
|
|
======== ||:Tutor || |:::::| ========
|
|
======== |'-..................-'| |____o| ========
|
|
======== `"")----------------(""` ___________ ========
|
|
======== /::::::::::| |::::::::::\ \ no mouse \ ========
|
|
======== /:::========| |==hjkl==:::\ \ required \ ========
|
|
======== '""""""""""""' '""""""""""""' '""""""""""' ========
|
|
======== ========
|
|
=====================================================================
|
|
=====================================================================
|
|
|
|
|
|
|
|
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
|
|
|
|
NVim 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:
|
|
- <escape key>
|
|
- :
|
|
- Tutor
|
|
- <enter key>
|
|
|
|
(If you already know how the Neovim basics, you can skip this step)
|
|
|
|
|
|
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 "<space>sh" to [s]earch the [h]elp documentation,
|
|
which is very useful when you're not sure exactly 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.
|
|
|
|
If you experience any errors while trying to install kickstart, run `:checkhealth` for more info
|
|
|
|
--]]
|
|
|
|
-- Set <space> 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 = ' '
|
|
|
|
require('Judokasarin.options')
|
|
require('Judokasarin.keymaps')
|
|
|
|
-- [[ Install `lazy.nvim` plugin manager ]]
|
|
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
|
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|
if not vim.loop.fs_stat(lazypath) then
|
|
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
|
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
|
end ---@diagnostic disable-next-line: undefined-field
|
|
vim.opt.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 {
|
|
{ import = 'Judokasarin.plugins' },
|
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
|
|
|
-- NOTE: Plugins can also be added by using a table,
|
|
-- with the first argument being the link and the following
|
|
-- keys can be used to configure plugin behavior/loading/etc.
|
|
--
|
|
-- Use `opts = {}` to force a plugin to be loaded.
|
|
--
|
|
-- This is equivalent to:
|
|
-- require('Comment').setup({})
|
|
|
|
-- "gc" to comment visual regions/lines
|
|
{ 'numToStr/Comment.nvim', opts = {} },
|
|
|
|
-- Here is a more advanced example where we pass configuration
|
|
-- options to `gitsigns.nvim`. This is equivalent to the following lua:
|
|
-- require('gitsigns').setup({ ... })
|
|
--
|
|
-- 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',
|
|
opts = {
|
|
signs = {
|
|
add = { text = '+' },
|
|
change = { text = '~' },
|
|
delete = { text = '_' },
|
|
topdelete = { text = '‾' },
|
|
changedelete = { text = '~' },
|
|
},
|
|
},
|
|
},
|
|
|
|
-- NOTE: Plugins can also be configured to run lua code when they are loaded.
|
|
--
|
|
-- This is often very useful to both group configuration, as well as handle
|
|
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
|
--
|
|
-- For example, in the following configuration, we use:
|
|
-- event = 'VeryLazy'
|
|
--
|
|
-- which loads which-key after all the UI elements are loaded. Events can be
|
|
-- normal autocommands events (`:help autocmd-events`).
|
|
--
|
|
-- Then, because we use the `config` key, the configuration only runs
|
|
-- after the plugin has been loaded:
|
|
-- config = function() ... end
|
|
|
|
{ -- Useful plugin to show you pending keybinds.
|
|
'folke/which-key.nvim',
|
|
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
|
|
config = function() -- This is the function that runs, AFTER loading
|
|
require('which-key').setup()
|
|
|
|
-- Document existing key chains
|
|
require('which-key').register {
|
|
['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
|
['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
|
['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
|
['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
|
['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
|
}
|
|
end,
|
|
},
|
|
|
|
-- NOTE: Plugins can specify dependencies.
|
|
--
|
|
-- The dependencies are proper plugin specifications as well - anything
|
|
-- you do for a plugin at the top level, you can do for a dependency.
|
|
--
|
|
-- Use the `dependencies` key to specify the dependencies of a particular plugin
|
|
|
|
|
|
-- Highlight todo, notes, etc in comments
|
|
{ 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
|
|
|
|
|
-- The following two 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
|
|
-- put them in the right spots if you want.
|
|
|
|
-- 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.
|
|
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
|
--
|
|
-- require 'kickstart.plugins.debug',
|
|
require 'kickstart.plugins.indent_line',
|
|
|
|
|
|
}
|
|
|
|
-- The line beneath this is called `modeline`. See `:help modeline`
|
|
-- vim: ts=2 sts=2 sw=2 et
|