feat(nvim): add nvim config
This commit is contained in:
101
.config/nvim/lua/colors/paradise.lua
Normal file
101
.config/nvim/lua/colors/paradise.lua
Normal file
@@ -0,0 +1,101 @@
|
||||
local base16 = require("base16")
|
||||
|
||||
_G.paradise_dark = base16.theme_from_array({
|
||||
"151515",
|
||||
"1f1f1f",
|
||||
"282828",
|
||||
"404040",
|
||||
"e8e3e3",
|
||||
"e8e3e3",
|
||||
"e8e3e3",
|
||||
"e8e3e3",
|
||||
"b66467",
|
||||
"d9bc8c",
|
||||
"d9bc8c",
|
||||
"8c977d",
|
||||
"8aa6a2",
|
||||
"8da3b9",
|
||||
"a988b0",
|
||||
"e8e3e3",
|
||||
})
|
||||
base16(_G.paradise_dark, true)
|
||||
|
||||
vim.api.nvim_command([[
|
||||
exe "hi StatusInactive guibg=background guifg=".g:terminal_color_8
|
||||
exe "hi StatusNormal guifg=background guibg=".g:terminal_color_2
|
||||
exe "hi StatusReplace guifg=background guibg=".g:terminal_color_1
|
||||
exe "hi StatusInsert guifg=background guibg=".g:terminal_color_2
|
||||
exe "hi StatusCommand guifg=background guibg=".g:terminal_color_3
|
||||
exe "hi StatusVisual guifg=background guibg=".g:terminal_color_4
|
||||
exe "hi StatusTerminal guifg=background guibg=".g:terminal_color_5
|
||||
|
||||
exe "hi FocusedSymbol guifg=".g:terminal_color_4
|
||||
exe "hi NeoTreeModified guifg=".g:terminal_color_9
|
||||
exe "hi NeoTreeIndentMarker guifg=".g:terminal_color_8
|
||||
exe "hi NeoTreeGitAdded guifg=".g:terminal_color_2
|
||||
exe "hi NeoTreeGitDeleted guifg=".g:terminal_color_9
|
||||
exe "hi NeoTreeGitRenamed guifg=".g:terminal_color_13
|
||||
exe "hi NeoTreeGitConflict guifg=".g:terminal_color_3
|
||||
exe "hi NeoTreeGitUntracked guifg=".g:terminal_color_9
|
||||
exe "hi NeoTreeGitModified guifg=".g:terminal_color_3
|
||||
|
||||
exe "hi CmpItemKindFunction guibg=NONE guifg=".g:terminal_color_15
|
||||
exe "hi CmpItemKindMethod guibg=NONE guifg=".g:terminal_color_15
|
||||
exe "hi CmpItemKindVariable guibg=NONE guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindKeyword guibg=NONE guifg=".g:terminal_color_5
|
||||
exe "hi CmpItemKindText guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindConstructor guifg=".g:terminal_color_11
|
||||
exe "hi CmpItemKindField guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindClass guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindInterface guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindModule guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindProperty guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindValue guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindEnum guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindSnippet guifg=".g:terminal_color_12
|
||||
exe "hi CmpItemKindFile guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindEnumMember guifg=".g:terminal_color_14
|
||||
exe "hi CmpItemKindConstant guifg=".g:terminal_color_11
|
||||
exe "hi CmpItemKindStruct guifg=".g:terminal_color_10
|
||||
exe "hi CmpItemKindTypeParameter guifg=".g:terminal_color_10
|
||||
|
||||
exe "hi DiagnosticError guifg=".g:terminal_color_9
|
||||
exe "hi DiagnosticWarn guifg=".g:terminal_color_3
|
||||
exe "hi DiagnosticInfo guifg=".g:terminal_color_14
|
||||
exe "hi DiagnosticHint guifg=".g:terminal_color_12
|
||||
|
||||
exe "hi Hlargs guifg=".g:terminal_color_1
|
||||
|
||||
hi EndOfBuffer guifg=background
|
||||
hi LineNr guibg=background
|
||||
hi LineNr guifg=#424242
|
||||
hi SignColumn guibg=background
|
||||
hi VertSplit guibg=background
|
||||
|
||||
hi! link TabLineSel StatusInsert
|
||||
hi TabLine guibg=#1f1f1f
|
||||
hi TabLine guifg=#525252
|
||||
hi TabLineFill guibg=background
|
||||
|
||||
hi FoldColumn guibg=background
|
||||
hi DiffAdd guibg=background
|
||||
hi DiffChange guibg=background
|
||||
hi DiffDelete guibg=background
|
||||
hi DiffText guibg=background
|
||||
|
||||
hi Pmenu guibg=background guifg=#424242
|
||||
hi PmenuSbar guibg=background guifg=#151515
|
||||
hi PmenuThumb guibg=#424242 guifg=#242424
|
||||
hi PmenuSel guibg=#242424 guifg=#BBB6B6
|
||||
|
||||
hi CmpItemAbbrMatch guifg=#e8e3e3
|
||||
hi CmpItemAbbrMatchFuzzy guifg=#e8e3e3
|
||||
hi CmpItemAbbr guifg=#424242
|
||||
hi CmpBorder guifg=#424242
|
||||
hi CmpItemMenu guifg=#888888
|
||||
|
||||
hi NormalFloat guifg=#e8e3e3
|
||||
hi NormalFloat guibg=none
|
||||
|
||||
hi WinSeparator guifg=#1f1f1f
|
||||
]])
|
||||
51
.config/nvim/lua/keybinds.lua
Normal file
51
.config/nvim/lua/keybinds.lua
Normal file
@@ -0,0 +1,51 @@
|
||||
vim.g.mapleader = " "
|
||||
vim.g.maplocalleader = "\\"
|
||||
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
map('n', 'd', '"_d', opts)
|
||||
map('v', 'd', '"_d', opts)
|
||||
|
||||
-- Update plugins
|
||||
map('n', '<leader>u', ':PackerSync<CR>', opts)
|
||||
|
||||
-- New file
|
||||
map('n', '<leader>n', '<cmd>enew<CR>', opts)
|
||||
|
||||
-- Resize splits
|
||||
map('n', '<C-Left>', ':vertical resize -3<CR>', opts)
|
||||
map('n', '<C-Right>', ':vertical resize +3<CR>', opts)
|
||||
map('n', '<C-Up>', ':resize +3<CR>', opts)
|
||||
map('n', '<C-Down>', ':resize -3<CR>', opts)
|
||||
|
||||
-- Nvim-tree.lua
|
||||
map('n', '<leader>e', ':NvimTreeToggle<CR>', opts)
|
||||
map('n', '<leader>f', ':NvimTreeFindFile<CR>', opts)
|
||||
|
||||
-- Toggleterm
|
||||
map('n', '<leader>t', ':ToggleTerm size=50 direction=vertical<CR>', opts)
|
||||
map('n', '<leader>T', ':ToggleTerm size=10 direction=horizontal<CR>', opts)
|
||||
|
||||
-- barbar mappings
|
||||
map('n', '<A-,>', ':BufferPrevious<CR>', opts)
|
||||
map('n', '<A-.>', ':BufferNext<CR>', opts)
|
||||
|
||||
map('n', '<A-<>', ':BufferMovePrevious<CR>', opts)
|
||||
map('n', '<A->>', ' :BufferMoveNext<CR>', opts)
|
||||
|
||||
map('n', '<A-1>', ':BufferGoto 1<CR>', opts)
|
||||
map('n', '<A-2>', ':BufferGoto 2<CR>', opts)
|
||||
map('n', '<A-3>', ':BufferGoto 3<CR>', opts)
|
||||
map('n', '<A-4>', ':BufferGoto 4<CR>', opts)
|
||||
map('n', '<A-5>', ':BufferGoto 5<CR>', opts)
|
||||
map('n', '<A-6>', ':BufferGoto 6<CR>', opts)
|
||||
map('n', '<A-7>', ':BufferGoto 7<CR>', opts)
|
||||
map('n', '<A-8>', ':BufferGoto 8<CR>', opts)
|
||||
map('n', '<A-9>', ':BufferGoto 9<CR>', opts)
|
||||
map('n', '<A-0>', ':BufferLast<CR>', opts)
|
||||
|
||||
map('n', '<A-c>', ':BufferClose<CR>', opts)
|
||||
|
||||
-- Compile a C file
|
||||
map('n', '<leader>c', ':w<CR>:!gcc % -o %:r && ./%:r<CR>:botright 15split | term ./%:r<CR>:startinsert<CR>', opts)
|
||||
8
.config/nvim/lua/options.lua
Normal file
8
.config/nvim/lua/options.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
vim.opt.termguicolors = true
|
||||
vim.o.number = true
|
||||
vim.o.mouse = 'a'
|
||||
vim.o.ignorecase = true
|
||||
vim.o.syntax = 'on'
|
||||
vim.o.clipboard = "unnamedplus" -- Install wl-clipboard or xclip
|
||||
87
.config/nvim/lua/plugins.lua
Normal file
87
.config/nvim/lua/plugins.lua
Normal file
@@ -0,0 +1,87 @@
|
||||
local fn = vim.fn
|
||||
|
||||
-- Automatically install packer
|
||||
local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim"
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
PACKER_BOOTSTRAP = fn.system {
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"https://github.com/wbthomason/packer.nvim",
|
||||
install_path,
|
||||
}
|
||||
print "Installing packer close and reopen Neovim..."
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
-- Autocommand that reloads neovim whenever you save the plugins.lua file
|
||||
vim.cmd [[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerSync
|
||||
augroup end
|
||||
]]
|
||||
|
||||
-- Use a protected call so we don't error out on first use
|
||||
local status_ok, packer = pcall(require, "packer")
|
||||
if not status_ok then
|
||||
return
|
||||
end
|
||||
|
||||
-- Have packer use a popup window
|
||||
packer.init {
|
||||
display = {
|
||||
open_fn = function()
|
||||
return require("packer.util").float { border = "rounded" }
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
||||
-- returns the require for use in `config` parameter of packer's use
|
||||
-- expects the name of the config file
|
||||
function get_setup(name)
|
||||
return string.format('require("setup/%s")', name)
|
||||
end
|
||||
|
||||
-- Plugins
|
||||
local plugins = {
|
||||
-- Core
|
||||
{ 'wbthomason/packer.nvim' },
|
||||
|
||||
-- Utils
|
||||
{ 'nathom/filetype.nvim' },
|
||||
{ 'sheerun/vim-polyglot' },
|
||||
{ 'kyazdani42/nvim-tree.lua', config = get_setup('nvim-tree') },
|
||||
{ 'windwp/nvim-autopairs', config = get_setup('autopairs') },
|
||||
{ 'norcalli/nvim-colorizer.lua', config = get_setup('nvim-colorizer') },
|
||||
{ 'norcalli/nvim-base16.lua' },
|
||||
{"akinsho/toggleterm.nvim", tag = '*', config = function() require("toggleterm").setup() end},
|
||||
|
||||
-- Ui
|
||||
{ 'kyazdani42/nvim-web-devicons'},
|
||||
{ 'ryanoasis/vim-devicons' },
|
||||
|
||||
-- Statusline
|
||||
{
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = get_setup('lualine'),
|
||||
requires = { 'kyazdani42/nvim-web-devicons', opt = true },
|
||||
},
|
||||
|
||||
-- Statusbar
|
||||
{ 'romgrk/barbar.nvim', config = get_setup('barbar') },
|
||||
}
|
||||
|
||||
-- Load Plugins
|
||||
return packer.startup(function(use)
|
||||
for _, v in pairs(plugins) do
|
||||
use(v)
|
||||
end
|
||||
|
||||
|
||||
-- Automatically set up your configuration after cloning packer.nvim
|
||||
if PACKER_BOOTSTRAP then
|
||||
require("packer").sync()
|
||||
end
|
||||
end)
|
||||
1
.config/nvim/lua/setup/autopairs.lua
Normal file
1
.config/nvim/lua/setup/autopairs.lua
Normal file
@@ -0,0 +1 @@
|
||||
require("nvim-autopairs").setup{}
|
||||
10
.config/nvim/lua/setup/barbar.lua
Normal file
10
.config/nvim/lua/setup/barbar.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
vim.g.barbar_auto_setup = false -- disable auto-setup
|
||||
require('barbar').setup({
|
||||
auto_hide = false,
|
||||
animation = false,
|
||||
closable = true,
|
||||
clickable = true,
|
||||
insert_at_end = true,
|
||||
minimum_padding = 1,
|
||||
maximum_padding = 1,
|
||||
})
|
||||
7
.config/nvim/lua/setup/lualine.lua
Normal file
7
.config/nvim/lua/setup/lualine.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
component_separators = { left = '', right = '|'},
|
||||
section_separators = { left = '', right = ''},
|
||||
},
|
||||
}
|
||||
1
.config/nvim/lua/setup/nvim-colorizer.lua
Normal file
1
.config/nvim/lua/setup/nvim-colorizer.lua
Normal file
@@ -0,0 +1 @@
|
||||
require('colorizer').setup{}
|
||||
7
.config/nvim/lua/setup/nvim-tree.lua
Normal file
7
.config/nvim/lua/setup/nvim-tree.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
require('nvim-tree').setup({
|
||||
view = {
|
||||
side = "left",
|
||||
},
|
||||
hijack_cursor = true,
|
||||
update_cwd = true,
|
||||
})
|
||||
Reference in New Issue
Block a user