mirror of
https://github.com/Baipyrus/nvim-config.git
synced 2024-11-13 20:43:49 +00:00
Merge branch 'master' of https://github.com/Baipyrus/nvim-config
This commit is contained in:
commit
af52a45ee2
132
README.md
132
README.md
@ -1,40 +1,71 @@
|
|||||||
|
# nvim-config
|
||||||
|
|
||||||
## Introduction
|
## Introduction
|
||||||
|
|
||||||
This project is a fork of [dam9000/kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim.git)
|
*This is a fork of [dam9000/kickstart-modular.nvim](https://github.com/dam9000/kickstart-modular.nvim) that represents my personal configuration of Neovim.*
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
### Installation (Windows Only)
|
### Install Neovim
|
||||||
|
|
||||||
|
Kickstart.nvim targets *only* the latest
|
||||||
|
['stable'](https://github.com/neovim/neovim/releases/tag/stable) and latest
|
||||||
|
['nightly'](https://github.com/neovim/neovim/releases/tag/nightly) of Neovim.
|
||||||
|
If you are experiencing issues, please make sure you have the latest versions.
|
||||||
|
|
||||||
|
### Install External Dependencies
|
||||||
|
|
||||||
> **NOTE**
|
> **NOTE**
|
||||||
> [Backup](#FAQ) your previous configuration (if any exists)
|
> [Backup](#FAQ) your previous configuration (if any exists)
|
||||||
|
|
||||||
Neovim's configurations are located under the following path:
|
External Requirements:
|
||||||
|
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
|
||||||
|
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
||||||
|
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
|
||||||
|
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true
|
||||||
|
- Language Setup:
|
||||||
|
- If want to write Typescript, you need `npm`
|
||||||
|
- If want to write Golang, you will need `go`
|
||||||
|
- etc.
|
||||||
|
|
||||||
| Shell | PATH |
|
> **NOTE**
|
||||||
|
> See [Windows Installation](#Windows-Installation) to double check any additional Windows notes
|
||||||
|
|
||||||
|
Neovim's configurations are located under the following paths, depending on your OS:
|
||||||
|
|
||||||
|
| OS | PATH |
|
||||||
| :- | :--- |
|
| :- | :--- |
|
||||||
| cmd | `%userprofile%\AppData\Local\nvim\` |
|
| Linux, MacOS | `$XDG_CONFIG_HOME/nvim`, `~/.config/nvim` |
|
||||||
| powershell | `$env:USERPROFILE\AppData\Local\nvim\` |
|
| Windows (cmd)| `%userprofile%\AppData\Local\nvim\` |
|
||||||
|
| Windows (powershell)| `$env:USERPROFILE\AppData\Local\nvim\` |
|
||||||
|
|
||||||
- Download and install:
|
### Install this Configuration
|
||||||
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
|
|
||||||
- [MinGW](https://www.mingw-w64.org/)
|
|
||||||
> **NOTE**
|
|
||||||
> In this case, using [chocolatey](https://chocolatey.org/) is quick and easy
|
|
||||||
- [CMake](https://cmake.org/)
|
|
||||||
> **NOTE**
|
|
||||||
> Make sure to select 'add to PATH' during installation
|
|
||||||
- [MSBuild-Tools](https://github.com/bycloudai/InstallVSBuildToolsWindows)
|
|
||||||
- Clone this repository:
|
|
||||||
- on Windows (cmd)
|
|
||||||
```
|
|
||||||
git clone https://github.com/Baipyrus/nvim-config.git %userprofile%\AppData\Local\nvim\
|
|
||||||
```
|
|
||||||
|
|
||||||
- on Windows (powershell)
|
Clone it from GitHub:
|
||||||
```
|
|
||||||
git clone https://github.com/Baipyrus/nvim-config.git $env:USERPROFILE\AppData\Local\nvim\
|
|
||||||
```
|
|
||||||
|
|
||||||
|
<details><summary> Linux and Mac </summary>
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/dam9000/kickstart-modular.nvim.git "${XDG_CONFIG_HOME:-$HOME/.config}"/nvim
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
|
<details><summary> Windows </summary>
|
||||||
|
|
||||||
|
If you're using `cmd.exe`:
|
||||||
|
|
||||||
|
```bat
|
||||||
|
git clone https://github.com/Baipyrus/nvim-config.git %userprofile%\AppData\Local\nvim\
|
||||||
|
```
|
||||||
|
|
||||||
|
If you're using `powershell.exe`
|
||||||
|
|
||||||
|
```pwsh
|
||||||
|
git clone https://github.com/Baipyrus/nvim-config.git $env:USERPROFILE\AppData\Local\nvim\
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
### Post Installation
|
### Post Installation
|
||||||
|
|
||||||
@ -44,32 +75,43 @@ Start Neovim
|
|||||||
nvim
|
nvim
|
||||||
```
|
```
|
||||||
|
|
||||||
The `Lazy` plugin manager will start automatically on the first run and install the configured plugins. After the installation is complete you can press `q` to close the `Lazy` UI and **you are ready to go**! Next time you run nvim `Lazy` will no longer show up.
|
That's it! Lazy will install all the plugins you have. Use `:Lazy` to view
|
||||||
|
current plugin status.
|
||||||
If you would prefer to hide this step and run the plugin sync from the command line, you can use:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
nvim --headless "+Lazy! sync" +qa
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
### FAQ
|
### FAQ
|
||||||
|
|
||||||
* What should I do if I already have a pre-existing neovim configuration?
|
* What should I do if I already have a pre-existing neovim configuration?
|
||||||
* You should back it up, then delete all files associated with it.
|
* You should back it up, then delete all files associated with it.
|
||||||
* This includes your existing init.lua and the neovim files in `%userprofile%\AppData\Local\nvim-data\` (CMD) or `$env:USERPROFILE\AppData\Local\nvim-data\` (Powershell) which should be deleted afterwards.
|
* This includes your existing init.lua and the neovim files in `~/.local` which can be deleted with `rm -rf ~/.local/share/nvim/` or their windows counterparts in `AppData\Local\nvim-data`
|
||||||
* You may also want to look at the [migration guide for lazy.nvim](https://github.com/folke/lazy.nvim#-migration-guide)
|
* Can I keep my existing configuration in parallel to kickstart?
|
||||||
|
* Yes! You can use [NVIM_APPNAME](https://neovim.io/doc/user/starting.html#%24NVIM_APPNAME)`=nvim-NAME` to maintain multiple configurations. For example you can install the kickstart configuration in `~/.config/nvim-kickstart` and create an alias:
|
||||||
|
```sh
|
||||||
|
alias nvim-kickstart='NVIM_APPNAME="nvim-kickstart" nvim'
|
||||||
|
```
|
||||||
|
When you run Neovim using `nvim-kickstart` alias it will use the alternative config directory and the matching local directory `~/.local/share/nvim-kickstart`.
|
||||||
|
You could also run your configuration inline, for example in Windows Powershell:
|
||||||
|
```pwsh
|
||||||
|
$env:NVIM_APPNAME = 'nvim-kickstart'; nvim
|
||||||
|
```
|
||||||
* What if I want to "uninstall" this configuration:
|
* What if I want to "uninstall" this configuration:
|
||||||
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
|
* See [lazy.nvim uninstall](https://github.com/folke/lazy.nvim#-uninstalling) information
|
||||||
* Why is the kickstart `init.lua` a single file? Wouldn't it make sense to split it into multiple files?
|
|
||||||
* The main purpose of kickstart is to serve as a teaching tool and a reference
|
|
||||||
configuration that someone can easily `git clone` as a basis for their own.
|
|
||||||
As you progress in learning Neovim and Lua, you might consider splitting `init.lua`
|
|
||||||
into smaller parts. *This is the fork of the original project that splits the configuration into smaller parts.*
|
|
||||||
The original repo that maintains the exact
|
|
||||||
same functionality in a single `init.lua` file is available here:
|
|
||||||
* [kickstart.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)
|
|
||||||
|
|
||||||
|
### Windows Installation
|
||||||
|
|
||||||
|
Installation requires gcc and make, for which you don't need to change the config,
|
||||||
|
the easiest way is to use choco:
|
||||||
|
|
||||||
|
1. install [chocolatey](https://chocolatey.org/install)
|
||||||
|
either follow the instructions on the page or use winget,
|
||||||
|
run in cmd as **admin**:
|
||||||
|
```
|
||||||
|
winget install --accept-source-agreements chocolatey.chocolatey
|
||||||
|
```
|
||||||
|
|
||||||
|
2. install all requirements using choco, exit previous cmd and
|
||||||
|
open a new one so that choco path is set, run in cmd as **admin**:
|
||||||
|
```
|
||||||
|
choco install -y neovim git ripgrep wget fd unzip gzip mingw make
|
||||||
|
```
|
||||||
|
|
||||||
|
Then continue with the [Install Kickstart](#Install-this-Configuration) step.
|
||||||
|
3
init.lua
3
init.lua
@ -3,6 +3,9 @@
|
|||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
-- Set to true if you have a Nerd Font installed
|
||||||
|
vim.g.have_nerd_font = true
|
||||||
|
|
||||||
-- [[ Setting options ]]
|
-- [[ Setting options ]]
|
||||||
require 'options'
|
require 'options'
|
||||||
|
|
||||||
|
@ -12,13 +12,11 @@ vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagn
|
|||||||
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
||||||
|
|
||||||
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
-- Exit terminal mode in the builtin terminal with a shortcut that is a bit easier
|
||||||
-- for people to discover. Otherwise, you normally need to press <C-\><C-n>, which
|
|
||||||
-- is not what someone will guess without a bit more experience.
|
|
||||||
--
|
|
||||||
-- NOTE: This won't work in all terminal emulators/tmux/etc. Try your own mapping
|
|
||||||
-- or just use <C-\><C-n> to exit terminal mode
|
|
||||||
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
||||||
|
|
||||||
|
-- Open terminal in current window
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>to', '<cmd>term<cr>', { desc = '[T]erminal [O]pen' })
|
||||||
|
|
||||||
-- Disable arrow keys in normal mode
|
-- Disable arrow keys in normal mode
|
||||||
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
vim.keymap.set({ 'n', 'v' }, '<left>', '<cmd>echo "Use h to move!!"<CR>')
|
||||||
vim.keymap.set({ 'n', 'v' }, '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
vim.keymap.set({ 'n', 'v' }, '<right>', '<cmd>echo "Use l to move!!"<CR>')
|
||||||
@ -42,11 +40,11 @@ vim.keymap.set('v', '<leader>pny', '"_dP', { desc = '[P]aste [N]o [Y]ank' })
|
|||||||
-- Populate CMD to prepare for change directory
|
-- Populate CMD to prepare for change directory
|
||||||
vim.keymap.set('n', '<leader>cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
|
vim.keymap.set('n', '<leader>cd', ':cd ', { desc = 'Prepare CMD for [C]hange [D]irectory' })
|
||||||
|
|
||||||
-- Open git window from fugitive in full screen
|
-- Switch in fugitive.vim status window with the current one
|
||||||
vim.keymap.set({ 'n', 'v' }, '<leader>go', ':Git<enter><C-w>o', { desc = '[G]it [O]pen' })
|
vim.keymap.set('n', '<leader>gs', '<cmd>Gedit :<cr>', { desc = '[G]it [S]tatus' })
|
||||||
|
|
||||||
-- [[ Basic Autocommands ]]
|
-- [[ Basic Autocommands ]]
|
||||||
-- See :help lua-guide-autocommands
|
-- See `:help lua-guide-autocommands`
|
||||||
|
|
||||||
-- Highlight when yanking (copying) text
|
-- Highlight when yanking (copying) text
|
||||||
-- Try it with `yap` in normal mode
|
-- Try it with `yap` in normal mode
|
||||||
|
@ -6,21 +6,22 @@
|
|||||||
--]]
|
--]]
|
||||||
|
|
||||||
local check_version = function()
|
local check_version = function()
|
||||||
|
local verstr = string.format('%s.%s.%s', vim.version().major, vim.version().minor, vim.version().patch)
|
||||||
if not vim.version.cmp then
|
if not vim.version.cmp then
|
||||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
|
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
|
if vim.version.cmp(vim.version(), { 0, 9, 4 }) >= 0 then
|
||||||
vim.health.ok(string.format("Neovim version is: '%s'", tostring(vim.version())))
|
vim.health.ok(string.format("Neovim version is: '%s'", verstr))
|
||||||
else
|
else
|
||||||
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", tostring(vim.version())))
|
vim.health.error(string.format("Neovim out of date: '%s'. Upgrade to latest stable or nightly", verstr))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local check_external_reqs = function()
|
local check_external_reqs = function()
|
||||||
-- Basic utils: `git`, `make`, `unzip`
|
-- Basic utils: `git`, `make`, `unzip`
|
||||||
for _, exe in ipairs { 'git', 'cmake', 'rg' } do
|
for _, exe in ipairs { 'git', 'make', 'unzip', 'rg' } do
|
||||||
local is_executable = vim.fn.executable(exe) == 1
|
local is_executable = vim.fn.executable(exe) == 1
|
||||||
if is_executable then
|
if is_executable then
|
||||||
vim.health.ok(string.format("Found executable: '%s'", exe))
|
vim.health.ok(string.format("Found executable: '%s'", exe))
|
||||||
|
@ -10,10 +10,10 @@ return {
|
|||||||
-- Build Step is needed for regex support in snippets
|
-- Build Step is needed for regex support in snippets
|
||||||
-- This step is not supported in many windows environments
|
-- This step is not supported in many windows environments
|
||||||
-- Remove the below condition to re-enable on windows
|
-- Remove the below condition to re-enable on windows
|
||||||
if vim.fn.has 'win32' == 1 or vim.fn.executable 'cmake' == 0 then
|
if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
return 'cmake install_jsregexp'
|
return 'make install_jsregexp'
|
||||||
end)(),
|
end)(),
|
||||||
},
|
},
|
||||||
'saadparwaiz1/cmp_luasnip',
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
@ -35,7 +35,7 @@ return {
|
|||||||
-- Neovim. This is where `mason` and related plugins come into play.
|
-- Neovim. This is where `mason` and related plugins come into play.
|
||||||
--
|
--
|
||||||
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
-- If you're wondering about lsp vs treesitter, you can check out the wonderfully
|
||||||
-- and elegantly composed help section, :help lsp-vs-treesitter
|
-- and elegantly composed help section, `:help lsp-vs-treesitter`
|
||||||
|
|
||||||
-- This function gets run when an LSP attaches to a particular buffer.
|
-- This function gets run when an LSP attaches to a particular buffer.
|
||||||
-- That is to say, every time a new file is opened that is associated with
|
-- That is to say, every time a new file is opened that is associated with
|
||||||
@ -165,6 +165,9 @@ return {
|
|||||||
-- library = { vim.env.VIMRUNTIME },
|
-- library = { vim.env.VIMRUNTIME },
|
||||||
},
|
},
|
||||||
telemetry = { enable = false },
|
telemetry = { enable = false },
|
||||||
|
completion = {
|
||||||
|
callSnippet = 'Replace',
|
||||||
|
},
|
||||||
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
-- You can toggle below to ignore Lua_LS's noisy `missing-fields` warnings
|
||||||
-- diagnostics = { disable = { 'missing-fields' } },
|
-- diagnostics = { disable = { 'missing-fields' } },
|
||||||
},
|
},
|
||||||
@ -196,15 +199,11 @@ return {
|
|||||||
handlers = {
|
handlers = {
|
||||||
function(server_name)
|
function(server_name)
|
||||||
local server = servers[server_name] or {}
|
local server = servers[server_name] or {}
|
||||||
require('lspconfig')[server_name].setup {
|
-- This handles overriding only values explicitly passed
|
||||||
cmd = server.cmd,
|
-- by the server configuration above. Useful when disabling
|
||||||
settings = server.settings,
|
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
||||||
filetypes = server.filetypes,
|
server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
||||||
-- This handles overriding only values explicitly passed
|
require('lspconfig')[server_name].setup(server)
|
||||||
-- by the server configuration above. Useful when disabling
|
|
||||||
-- certain features of an LSP (for example, turning off formatting for tsserver)
|
|
||||||
capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {}),
|
|
||||||
}
|
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ return {
|
|||||||
-- Better Around/Inside textobjects
|
-- Better Around/Inside textobjects
|
||||||
--
|
--
|
||||||
-- Examples:
|
-- Examples:
|
||||||
-- - va) - [V]isually select [A]round [)]parenthen
|
-- - va) - [V]isually select [A]round [)]paren
|
||||||
-- - yinq - [Y]ank [I]nside [N]ext [']quote
|
-- - yinq - [Y]ank [I]nside [N]ext [']quote
|
||||||
-- - ci' - [C]hange [I]nside [']quote
|
-- - ci' - [C]hange [I]nside [']quote
|
||||||
require('mini.ai').setup { n_lines = 500 }
|
require('mini.ai').setup { n_lines = 500 }
|
||||||
@ -20,8 +20,15 @@ return {
|
|||||||
-- Simple and easy statusline.
|
-- Simple and easy statusline.
|
||||||
-- You could remove this setup call if you don't like it,
|
-- You could remove this setup call if you don't like it,
|
||||||
-- and try some other statusline plugin
|
-- and try some other statusline plugin
|
||||||
require('mini.statusline').setup()
|
local statusline = require 'mini.statusline'
|
||||||
MiniStatusline.section_location = function()
|
-- set use_icons to true if you have a Nerd Font
|
||||||
|
statusline.setup { use_icons = vim.g.have_nerd_font }
|
||||||
|
|
||||||
|
-- You can configure sections in the statusline by overriding their
|
||||||
|
-- default behavior. For example, here we set the section for
|
||||||
|
-- cursor location to LINE:COLUMN
|
||||||
|
---@diagnostic disable-next-line: duplicate-set-field
|
||||||
|
statusline.section_location = function()
|
||||||
return '%2l:%-2v'
|
return '%2l:%-2v'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
return {
|
return {
|
||||||
{ -- Fuzzy Finder (files, lsp, etc)
|
{ -- Fuzzy Finder (files, lsp, etc)
|
||||||
'nvim-telescope/telescope.nvim',
|
'nvim-telescope/telescope.nvim',
|
||||||
event = 'VeryLazy',
|
event = 'VimEnter',
|
||||||
branch = '0.1.x',
|
branch = '0.1.x',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
'nvim-lua/plenary.nvim',
|
'nvim-lua/plenary.nvim',
|
||||||
@ -17,20 +17,18 @@ return {
|
|||||||
|
|
||||||
-- `build` is used to run some command when the plugin is installed/updated.
|
-- `build` is used to run some command when the plugin is installed/updated.
|
||||||
-- This is only run then, not every time Neovim starts up.
|
-- This is only run then, not every time Neovim starts up.
|
||||||
build = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release; cmake --build build --config Release; cmake --install build --prefix build',
|
build = 'make',
|
||||||
|
|
||||||
-- `cond` is a condition used to determine whether this plugin should be
|
-- `cond` is a condition used to determine whether this plugin should be
|
||||||
-- installed and loaded.
|
-- installed and loaded.
|
||||||
cond = function()
|
cond = function()
|
||||||
return vim.fn.executable 'cmake' == 1
|
return vim.fn.executable 'make' == 1
|
||||||
end,
|
end,
|
||||||
},
|
},
|
||||||
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
{ 'nvim-telescope/telescope-ui-select.nvim' },
|
||||||
|
|
||||||
-- Useful for getting pretty icons, but requires special font.
|
-- Useful for getting pretty icons, but requires a Nerd Font.
|
||||||
-- If you already have a Nerd Font, or terminal set up with fallback fonts
|
{ 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
||||||
-- you can enable this
|
|
||||||
{ 'nvim-tree/nvim-web-devicons' },
|
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
-- Telescope is a fuzzy finder that comes with a lot of different things that
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
-- Highlight todo, notes, etc in comments
|
-- Highlight todo, notes, etc in comments
|
||||||
return {
|
return {
|
||||||
{ 'folke/todo-comments.nvim', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
{ 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
||||||
}
|
}
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
@ -8,7 +8,9 @@ return {
|
|||||||
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
lazy = false, -- make sure we load this during startup if it is your main colorscheme
|
||||||
priority = 1000, -- make sure to load this before all the other start plugins
|
priority = 1000, -- make sure to load this before all the other start plugins
|
||||||
config = function()
|
config = function()
|
||||||
-- Load the colorscheme here
|
-- Load the colorscheme here.
|
||||||
|
-- Like many other themes, this one has different styles, and you could load
|
||||||
|
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||||
vim.cmd.colorscheme 'tokyonight-night'
|
vim.cmd.colorscheme 'tokyonight-night'
|
||||||
|
|
||||||
-- You can configure highlights by doing something like
|
-- You can configure highlights by doing something like
|
||||||
|
@ -3,6 +3,7 @@ return {
|
|||||||
{ -- Highlight, edit, and navigate code
|
{ -- Highlight, edit, and navigate code
|
||||||
'nvim-treesitter/nvim-treesitter',
|
'nvim-treesitter/nvim-treesitter',
|
||||||
dependencies = {
|
dependencies = {
|
||||||
|
'windwp/nvim-ts-autotag',
|
||||||
'nvim-treesitter/nvim-treesitter-context',
|
'nvim-treesitter/nvim-treesitter-context',
|
||||||
'nvim-treesitter/nvim-treesitter-textobjects',
|
'nvim-treesitter/nvim-treesitter-textobjects',
|
||||||
},
|
},
|
||||||
@ -15,6 +16,11 @@ return {
|
|||||||
ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' },
|
ensure_installed = { 'lua', 'python', 'rust', 'javascript', 'typescript', 'vimdoc', 'vim', 'svelte', 'c_sharp' },
|
||||||
-- Autoinstall languages that are not installed
|
-- Autoinstall languages that are not installed
|
||||||
auto_install = false,
|
auto_install = false,
|
||||||
|
-- Enable autotags and -rename
|
||||||
|
autotag = {
|
||||||
|
enable = true,
|
||||||
|
enable_autocmd = true,
|
||||||
|
},
|
||||||
-- Install languages synchronously (only applied to `ensure_installed`)
|
-- Install languages synchronously (only applied to `ensure_installed`)
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
highlight = { enable = true },
|
highlight = { enable = true },
|
||||||
|
@ -4,10 +4,10 @@
|
|||||||
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
-- lazy loading plugins that don't need to be loaded immediately at startup.
|
||||||
--
|
--
|
||||||
-- For example, in the following configuration, we use:
|
-- For example, in the following configuration, we use:
|
||||||
-- event = 'VeryLazy'
|
-- event = 'VimEnter'
|
||||||
--
|
--
|
||||||
-- which loads which-key after all the UI elements are loaded. Events can be
|
-- which loads which-key before all the UI elements are loaded. Events can be
|
||||||
-- normal autocommands events (:help autocomd-events).
|
-- normal autocommands events (`:help autocmd-events`).
|
||||||
--
|
--
|
||||||
-- Then, because we use the `config` key, the configuration only runs
|
-- Then, because we use the `config` key, the configuration only runs
|
||||||
-- after the plugin has been loaded:
|
-- after the plugin has been loaded:
|
||||||
@ -16,7 +16,7 @@
|
|||||||
return {
|
return {
|
||||||
{ -- Useful plugin to show you pending keybinds.
|
{ -- Useful plugin to show you pending keybinds.
|
||||||
'folke/which-key.nvim',
|
'folke/which-key.nvim',
|
||||||
event = 'VeryLazy', -- Sets the loading event to 'VeryLazy'
|
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
|
||||||
config = function() -- This is the function that runs, AFTER loading
|
config = function() -- This is the function that runs, AFTER loading
|
||||||
require('which-key').setup()
|
require('which-key').setup()
|
||||||
|
|
||||||
|
@ -9,8 +9,7 @@
|
|||||||
-- :Lazy update
|
-- :Lazy update
|
||||||
--
|
--
|
||||||
-- NOTE: Here is where you install your plugins.
|
-- NOTE: Here is where you install your plugins.
|
||||||
require('lazy').setup {
|
require('lazy').setup({
|
||||||
|
|
||||||
-- [[ Plugin Specs list ]]
|
-- [[ Plugin Specs list ]]
|
||||||
|
|
||||||
-- NOTE: First, some plugins that don't require any configuration
|
-- NOTE: First, some plugins that don't require any configuration
|
||||||
@ -27,6 +26,34 @@ require('lazy').setup {
|
|||||||
-- Processing-Java
|
-- Processing-Java
|
||||||
'sophacles/vim-processing',
|
'sophacles/vim-processing',
|
||||||
|
|
||||||
|
-- Smooth scroll plugin and keymaps
|
||||||
|
{
|
||||||
|
'karb94/neoscroll.nvim',
|
||||||
|
config = function()
|
||||||
|
require('neoscroll').setup {
|
||||||
|
hide_cursor = false,
|
||||||
|
easing_function = nil,
|
||||||
|
respect_scrolloff = true,
|
||||||
|
}
|
||||||
|
|
||||||
|
require('neoscroll.config').set_mappings {
|
||||||
|
-- Scroll normally
|
||||||
|
['<C-u>'] = { 'scroll', { '-vim.wo.scroll', 'true', '50' } },
|
||||||
|
['<C-d>'] = { 'scroll', { 'vim.wo.scroll', 'true', '50' } },
|
||||||
|
-- Scroll entire page height
|
||||||
|
['<C-b>'] = { 'scroll', { '-vim.api.nvim_win_get_height(0)', 'true', '80' } },
|
||||||
|
['<C-f>'] = { 'scroll', { 'vim.api.nvim_win_get_height(0)', 'true', '80' } },
|
||||||
|
-- Scroll 10% at a time
|
||||||
|
['<C-y>'] = { 'scroll', { '-0.10', 'false', '25' } },
|
||||||
|
['<C-e>'] = { 'scroll', { '0.10', 'false', '25' } },
|
||||||
|
-- Jump to top, bottom and center
|
||||||
|
['zt'] = { 'zt', { '40' } },
|
||||||
|
['zz'] = { 'zz', { '50' } },
|
||||||
|
['zb'] = { 'zb', { '40' } },
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
|
||||||
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
|
||||||
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
|
||||||
|
|
||||||
@ -84,8 +111,28 @@ require('lazy').setup {
|
|||||||
-- This is the easiest way to modularize your config.
|
-- 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.
|
-- 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
|
-- For additional information, see `:help lazy.nvim-lazy.nvim-structuring-your-plugins`
|
||||||
{ import = 'custom.plugins' },
|
{ import = 'custom.plugins' },
|
||||||
}
|
}, {
|
||||||
|
ui = {
|
||||||
|
-- If you have a Nerd Font, set icons to an empty table which will use the
|
||||||
|
-- default lazy.nvim defined Nerd Font icons otherwise define a unicode icons table
|
||||||
|
icons = vim.g.have_nerd_font and {} or {
|
||||||
|
cmd = '⌘',
|
||||||
|
config = '🛠',
|
||||||
|
event = '📅',
|
||||||
|
ft = '📂',
|
||||||
|
init = '⚙',
|
||||||
|
keys = '🗝',
|
||||||
|
plugin = '🔌',
|
||||||
|
runtime = '💻',
|
||||||
|
require = '🌙',
|
||||||
|
source = '📄',
|
||||||
|
start = '🚀',
|
||||||
|
task = '📌',
|
||||||
|
lazy = '💤 ',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
@ -62,8 +62,8 @@ vim.opt.splitright = true
|
|||||||
vim.opt.splitbelow = true
|
vim.opt.splitbelow = true
|
||||||
|
|
||||||
-- Sets how neovim will display certain whitespace in the editor.
|
-- Sets how neovim will display certain whitespace in the editor.
|
||||||
-- See :help 'list'
|
-- See `:help 'list'`
|
||||||
-- and :help 'listchars'
|
-- and `:help 'listchars'`
|
||||||
vim.opt.list = true
|
vim.opt.list = true
|
||||||
vim.opt.listchars = {
|
vim.opt.listchars = {
|
||||||
tab = '» ',
|
tab = '» ',
|
||||||
@ -77,7 +77,8 @@ vim.opt.inccommand = 'split'
|
|||||||
-- Show which line your cursor is on
|
-- Show which line your cursor is on
|
||||||
vim.opt.cursorline = true
|
vim.opt.cursorline = true
|
||||||
|
|
||||||
-- Minimal number of screen lines to keep above and below the cursor.
|
-- Minimal spacing to keep around the cursor.
|
||||||
vim.opt.scrolloff = 8
|
vim.opt.scrolloff = 8
|
||||||
|
vim.opt.sidescrolloff = 12
|
||||||
|
|
||||||
-- vim: ts=2 sts=2 sw=2 et
|
-- vim: ts=2 sts=2 sw=2 et
|
||||||
|
Loading…
Reference in New Issue
Block a user