Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
140 changes: 15 additions & 125 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,89 +1,3 @@
--[[

=====================================================================
==================== 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:
- <escape key>
- :
- Tutor
- <enter key>

(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 "<space>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 <space> as the leader key
-- See `:help mapleader`
-- NOTE: Must happen before plugins are loaded (otherwise wrong leader will be used)
Expand All @@ -102,7 +16,7 @@ vim.g.have_nerd_font = false
vim.opt.number = true
-- You can also add relative line numbers, to help with jumping.
-- Experiment for yourself to see if you like it!
-- vim.opt.relativenumber = true
vim.opt.relativenumber = true

-- Enable mouse mode, can be useful for resizing splits for example!
vim.opt.mouse = 'a'
Expand Down Expand Up @@ -280,12 +194,18 @@ require('lazy').setup({
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' },
local wk = require 'which-key'
wk.add {
{ '<leader>c', group = '[C]ode' },
{ '<leader>c_', hidden = true },
{ '<leader>d', group = '[D]ocument' },
{ '<leader>d_', hidden = true },
{ '<leader>r', group = '[R]ename' },
{ '<leader>r_', hidden = true },
{ '<leader>s', group = '[S]earch' },
{ '<leader>s_', hidden = true },
{ '<leader>w', group = '[W]orkspace' },
{ '<leader>w_', hidden = true },
}
end,
},
Expand Down Expand Up @@ -702,7 +622,7 @@ require('lazy').setup({
-- Accept ([y]es) the completion.
-- This will auto-import if your LSP supports it.
-- This will expand snippets if the LSP sent a snippet.
['<C-y>'] = cmp.mapping.confirm { select = true },
['<cr>'] = cmp.mapping.confirm { select = true },

-- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display
Expand Down Expand Up @@ -798,36 +718,6 @@ require('lazy').setup({
-- Check out: https://github.com/echasnovski/mini.nvim
end,
},
{ -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc' },
-- Autoinstall languages that are not installed
auto_install = true,
highlight = {
enable = true,
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
-- If you are experiencing weird indenting issues, add the language to
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`

---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup(opts)

-- There are additional nvim-treesitter modules that you can use to interact
-- with nvim-treesitter. You should go explore a few and see what interests you:
--
-- - Incremental selection: Included, see `:help nvim-treesitter-incremental-selection-mod`
-- - Show your current context: https://github.com/nvim-treesitter/nvim-treesitter-context
-- - Treesitter + textobjects: https://github.com/nvim-treesitter/nvim-treesitter-textobjects
end,
},

-- 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
Expand All @@ -847,7 +737,7 @@ require('lazy').setup({
--
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
-- { import = 'custom.plugins' },
{ import = 'custom.plugins' },
}, {
ui = {
-- If you are using a Nerd Font: set icons to an empty table which will use the
Expand Down
36 changes: 35 additions & 1 deletion lua/custom/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,38 @@
-- I promise not to create any merge conflicts in this directory :)
--
-- See the kickstart.nvim README for more information
return {}
return {
{
'OXY2DEV/markview.nvim',
lazy = false, -- Recommended
-- ft = "markdown" -- If you decide to lazy-load anyway

dependencies = {
'nvim-treesitter/nvim-treesitter',
'nvim-tree/nvim-web-devicons',
},

opts = {
initial_state = false,
},
config = function(_, opts)
require('markview').setup(opts)

-- This function imitates the behavior of Joplin when rendering notes
local splitToggle_state = 0
vim.keymap.set('n', '<C-ö>', function()
if splitToggle_state == 0 then
vim.cmd 'Markview enableAll'
splitToggle_state = 1
elseif splitToggle_state == 1 then
vim.cmd 'Markview splitEnable'
splitToggle_state = 2
else
vim.cmd 'Markview splitDisable'
vim.cmd 'Markview disableAll'
splitToggle_state = 0
end
end, { silent = true, desc = 'Toggle Markview split view' })
end,
},
}
9 changes: 9 additions & 0 deletions windows-install/addNvimContextMenuEntry.reg
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Open In NVim]
"icon"="C:\\Program Files\\Neovim\\bin\\nvim.ico"
"position"="top"

[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Open In NVim\command]
@="C:\\Program Files\\Neovim\\bin\\nvim-qt.exe %1"

29 changes: 29 additions & 0 deletions windows-install/neovim-install.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Neovim installation script
$NvimConfigRepo = "https://github.com/kontr0x/my-kickstart.nvim.git"

## Install git and neovim via winget
winget install -e --id Git.Git
winget install -e --id Neovim.Neovim

$NvimConfigPath = (Join-Path -Path $env:LOCALAPPDATA -ChildPath "nvim")
New-Item -ItemType Directory -Force -Path $NvimConfigPath

if((Get-ChildItem $NvimConfigPath -force | Select-Object -First 1 | Measure-Object).Count -eq 0){
Write-Host "Cloning the repo" $NvimConfigRepo "into" $NvimConfigPath "!"
Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "clone $NvimConfigRepo $NvimConfigPath" -Wait -NoNewWindow
}else{
Write-Host "Directory not empty, assume that the repo is already cloned. Trying to update repo!"
Start-Process -FilePath "C:\Program Files\Git\bin\git.exe" -ArgumentList "pull" -Wait -NoNewWindow
}

## Adding powershell aliases for nvim
New-Item -ItemType File -Path $profile

$NvimPowershellAliases = @"
`n# NeoVim aliases for powershell
Set-Alias -Name nvim -Value "C:\Program Files\Neovim\bin\nvim.exe"
Set-Alias -Name vim -Value nvim
Set-Alias -Name vi -Value nvim
"@

$NvimPowershellAliases | Add-Content -Path $profile
Binary file added windows-install/nvim.ico
Binary file not shown.
Loading