-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor Neovim config using Lua and lazy.nvim
- Loading branch information
Showing
52 changed files
with
261 additions
and
268 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
vim.g.mapleader = " " | ||
vim.g.maplocalleader = "\\" | ||
|
||
-- Config files | ||
require("config.general") | ||
require("config.abbreviations") | ||
require("config.formatting") | ||
require("config.remaps") | ||
require("config.visual") | ||
|
||
-- Plugin manager | ||
require("config.lazy") |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"NeoSolarized.nvim": { "branch": "master", "commit": "bdfcdd056c4c73b10fc6f42f0c2d0df839ff49ae" }, | ||
"bullets.vim": { "branch": "master", "commit": "2253f970e54320dbd76fd6bb4f5a0bf2436ce232" }, | ||
"csv.vim": { "branch": "master", "commit": "bddfcbadd788ab11eb3dbba4550a38a412fe3705" }, | ||
"lazy.nvim": { "branch": "main", "commit": "b1134ab82ee4279e31f7ddf7e34b2a99eb9b7bc9" }, | ||
"nvim-solarized-lua": { "branch": "master", "commit": "d69a263c97cbc765ca442d682b3283aefd61d4ac" }, | ||
"tcomment_vim": { "branch": "master", "commit": "48ab639a461d9b8344f7fee06cb69b4374863b13" }, | ||
"vim-css-color": { "branch": "master", "commit": "950e80352b325ff26d3b0faf95b29e301c200f7d" }, | ||
"vim-easy-align": { "branch": "master", "commit": "9815a55dbcd817784458df7a18acacc6f82b1241" }, | ||
"vim-fugitive": { "branch": "master", "commit": "d4877e54cef67f5af4f950935b1ade19ed6b7370" }, | ||
"vim-gitgutter": { "branch": "main", "commit": "7b0b5098e3e57be86bb96cfbf2b8902381eef57c" }, | ||
"vim-gutentags": { "branch": "master", "commit": "aa47c5e29c37c52176c44e61c780032dfacef3dd" }, | ||
"vim-lastplace": { "branch": "master", "commit": "e58cb0df716d3c88605ae49db5c4741db8b48aa9" }, | ||
"vim-obsession": { "branch": "master", "commit": "ed9dfc7c2cc917ace8b24f4f9f80a91e05614b63" }, | ||
"vim-repeat": { "branch": "master", "commit": "65846025c15494983dafe5e3b46c8f88ab2e9635" }, | ||
"vim-rhubarb": { "branch": "master", "commit": "ee69335de176d9325267b0fd2597a22901d927b1" }, | ||
"vim-sleuth": { "branch": "master", "commit": "be69bff86754b1aa5adcbb527d7fcd1635a84080" }, | ||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" }, | ||
"vim-system-copy": { "branch": "master", "commit": "8abd9ed21016bdc21b458c79da3b9ac0ee25c1ce" }, | ||
"vim-textobj-codeblock": { "branch": "master", "commit": "7658826f1a13a2865fb65b64481c40968fd780c1" }, | ||
"vim-textobj-entire": { "branch": "master", "commit": "64a856c9dff3425ed8a863b9ec0a21dbaee6fb3a" }, | ||
"vim-textobj-indent": { "branch": "master", "commit": "deb76867c302f933c8f21753806cbf2d8461b548" }, | ||
"vim-textobj-line": { "branch": "master", "commit": "1a6780d29adcf7e464e8ddbcd0be0a9df1a37339" }, | ||
"vim-textobj-quotes": { "branch": "master", "commit": "cca9686acf7b21d930ced1801120ecf23fb2f995" }, | ||
"vim-textobj-user": { "branch": "master", "commit": "41a675ddbeefd6a93664a4dc52f302fe3086a933" }, | ||
"vim-wordmotion": { "branch": "master", "commit": "81d9bd298376ab0dc465c85d55afa4cb8d5f47a1" } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-- Vertical split find | ||
vim.keymap.set('ca', 'vsfind', 'vert sfind') | ||
|
||
-- Vertical split existing buffer | ||
vim.keymap.set('ca', 'vsb', 'vert sbuffer') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
-- Formatting settings | ||
---------------------- | ||
|
||
-- Set maximum line length | ||
vim.opt.textwidth = 80 | ||
|
||
-- Formatting options: | ||
-- j Remove comment leaders when joining lines (where it makes sense) | ||
-- tc Auto-wrap in both text and comments | ||
-- r Continue comment on new line when hitting <Enter> in insert mode | ||
-- o Continue comment on new line when hitting "o" or "O" | ||
-- q Allow formatting comments with "gq" | ||
-- l Don't automatically break the line if it was already longer than | ||
-- 'textwidth' when the insert command started | ||
-- 1 Don't break a line after a one-letter word; break it before it if possible | ||
vim.opt.formatoptions = jtcroql1 | ||
|
||
-- 2 space indentation | ||
vim.opt.tabstop = 2 | ||
vim.opt.shiftwidth = 2 | ||
vim.opt.shiftround = true | ||
vim.opt.expandtab = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
-- General Vim Settings | ||
-- -------------------- | ||
|
||
-- vim.g.python_indent = {} | ||
-- vim.g.python_indent.open_paren = 'shiftwidth()' | ||
-- vim.g.python_indent.closed_paren_align_last_line = v:false | ||
|
||
vim.g.python_indent = { | ||
open_paren = 'shiftwidth()', | ||
closed_paren_align_last_line = false, | ||
} | ||
|
||
-- Fuzzy file finding | ||
vim.opt.path:append '**' | ||
|
||
-- Assume POSIX-compliant shell syntax for highlighting purposes, when other | ||
-- detection methods fail | ||
vim.g.is_posix = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
-- Bootstrap lazy.nvim | ||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" | ||
if not (vim.uv or vim.loop).fs_stat(lazypath) then | ||
local lazyrepo = "https://github.com/folke/lazy.nvim.git" | ||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) | ||
if vim.v.shell_error ~= 0 then | ||
vim.api.nvim_echo({ | ||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, | ||
{ out, "WarningMsg" }, | ||
{ "\nPress any key to exit..." }, | ||
}, true, {}) | ||
vim.fn.getchar() | ||
os.exit(1) | ||
end | ||
end | ||
vim.opt.rtp:prepend(lazypath) | ||
|
||
-- Setup lazy.nvim | ||
require("lazy").setup({ | ||
spec = { | ||
-- import your plugins | ||
{ import = "plugins" }, | ||
}, | ||
-- colorscheme that will be used when installing plugins. | ||
install = { colorscheme = { "solarized" } }, | ||
-- automatically check for plugin updates | ||
checker = { enabled = true }, | ||
change_detection = { | ||
-- automatically check for config file changes and reload the ui | ||
enabled = true, | ||
notify = false, -- don't get a notification when changes are found | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- Alt + j/k to move current line down/up in normal mode | ||
vim.keymap.set("n", "<A-j>", ":m .+1<CR>==") | ||
vim.keymap.set("n", "<A-k>", ":m .-2<CR>==") | ||
-- in insert mode | ||
vim.keymap.set("i", "<A-j>", "<Esc>:m .+1<CR>==gi") | ||
vim.keymap.set("i", "<A-k>", "<Esc>:m .-2<CR>==gi") | ||
-- and in visual mode | ||
vim.keymap.set("v", "<A-j>", ":m '>+1<CR>gv=gv") | ||
vim.keymap.set("v", "<A-k>", ":m '<-2<CR>gv=gv") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
-- Visual settings | ||
------------------ | ||
|
||
-- Make it obvious where the textwidth limit is | ||
vim.opt.colorcolumn = '+1' | ||
|
||
-- Display extra whitespace | ||
vim.opt.list = true | ||
vim.opt.listchars:append { | ||
tab = "▏ ", | ||
leadmultispace = "▏ ", | ||
trail = "·", | ||
nbsp = "·", | ||
multispace = "·", | ||
} | ||
|
||
-- Display relative line numbers, with absolute line number for current line | ||
vim.opt.number = true | ||
vim.opt.numberwidth = 5 | ||
vim.opt.relativenumber = true | ||
|
||
-- Automatically turn off relative line numbers when not in focus | ||
-- ... But also don't turn them on and off for help buffers! | ||
local numbertogglegroup = | ||
vim.api.nvim_create_augroup('numbertoggle', { clear = true }) | ||
vim.api.nvim_create_autocmd({ 'BufEnter', 'FocusGained', 'InsertLeave' }, { | ||
callback = function() | ||
if vim.bo.filetype ~= 'help' then | ||
vim.opt.relativenumber = true | ||
end | ||
end, | ||
group = numbertogglegroup, | ||
pattern = '*', | ||
}) | ||
vim.api.nvim_create_autocmd({ 'BufLeave', 'FocusLost', 'InsertEnter' }, { | ||
callback = function() | ||
vim.opt.relativenumber = false | ||
end, | ||
group = numbertogglegroup, | ||
pattern = '*', | ||
}) | ||
|
||
-- Open new split panes to right and bottom | ||
vim.opt.splitbelow = true | ||
vim.opt.splitright = true | ||
|
||
-- Ignore whitespace only changes in diff, always use vertical diffs | ||
vim.opt.diffopt:append { | ||
iwhite, | ||
vertical, | ||
'linematch:60', | ||
algorithm = histogram, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'bullets-vim/bullets.vim' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'ap/vim-css-color' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'chrisbra/csv.vim' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
return { | ||
{ | ||
'junegunn/vim-easy-align', | ||
keys = { | ||
-- Start interactive EasyAlign in visual mode (e.g. vipga) | ||
{ "ga", "<Plug>(EasyAlign)", mode = "x" }, | ||
-- Start interactive EasyAlign for a motion/text object (e.g. gaip) | ||
{ "ga", "<Plug>(EasyAlign)" }, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-fugitive' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'airblade/vim-gitgutter' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'ludovicchabant/vim-gutentags' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'farmergreg/vim-lastplace' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
return { | ||
{ | ||
'ishan9299/nvim-solarized-lua', | ||
lazy = false, | ||
priority = 1000, | ||
config = function() | ||
vim.cmd([[ colorscheme solarized ]]) | ||
end, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-obsession' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-repeat' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-rhubarb' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-sleuth' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tpope/vim-surround' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'christoomey/vim-system-copy' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
return { | ||
{ 'tomtom/tcomment_vim' } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
return { | ||
{ | ||
"kana/vim-textobj-user", | ||
priority = 100, | ||
}, | ||
{ "kana/vim-textobj-line" }, | ||
{ "kana/vim-textobj-indent" }, | ||
{ "kana/vim-textobj-entire" }, | ||
{ "beloglazov/vim-textobj-quotes" }, | ||
{ "christoomey/vim-textobj-codeblock" }, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
return { | ||
{ | ||
'chaoren/vim-wordmotion', | ||
init = function() | ||
vim.g.wordmotion_prefix = '<leader>' | ||
end, | ||
}, | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.