Rewrite Neovim config
This commit is contained in:
parent
e3afc7c531
commit
b8c03461bb
11 changed files with 193 additions and 59 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
.DS_Store
|
|
@ -1,3 +1,29 @@
|
|||
-- Bootstrap
|
||||
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
|
||||
local is_bootstrap = false
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
is_bootstrap = true
|
||||
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
require('plugins.packer')
|
||||
|
||||
|
||||
-- When we are bootstrapping a configuration, it doesn't
|
||||
-- make sense to execute the rest of the init.lua.
|
||||
--
|
||||
-- You'll need to restart nvim, and then it will work.
|
||||
if is_bootstrap then
|
||||
print '=================================='
|
||||
print ' Plugins are being installed'
|
||||
print ' Wait until Packer completes,'
|
||||
print ' then restart nvim'
|
||||
print '=================================='
|
||||
return
|
||||
end
|
||||
|
||||
-- General Configuration
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.ignorecase = true
|
||||
|
@ -5,63 +31,6 @@ vim.opt.tabstop = 2
|
|||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.cmd('colorscheme base16-material-darker')
|
||||
|
||||
require("transparent").setup({
|
||||
enable = true,
|
||||
})
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = { "vim", "c", "lua", "kotlin", "javascript", "typescript" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
}
|
||||
}
|
||||
|
||||
require("nvim-tree").setup({
|
||||
open_on_setup = true
|
||||
|
||||
})
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'base16',
|
||||
section_separators = { left = '', right = '' }
|
||||
},
|
||||
extensions = {'nvim-tree'}
|
||||
})
|
||||
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
||||
ts_update()
|
||||
end,
|
||||
}
|
||||
use 'p00f/nvim-ts-rainbow'
|
||||
use 'jiangmiao/auto-pairs'
|
||||
use {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
requires = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
use 'RRethy/nvim-base16'
|
||||
use 'xiyaowong/nvim-transparent'
|
||||
end)
|
||||
vim.cmd('colorscheme base16-tomorrow-night-eighties')
|
||||
|
||||
require('keybindings')
|
85
nvim/init.lua.old
Normal file
85
nvim/init.lua.old
Normal file
|
@ -0,0 +1,85 @@
|
|||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.tabstop = 2
|
||||
vim.opt.shiftwidth = 2
|
||||
vim.opt.expandtab = true
|
||||
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
vim.keymap.set('', '<Leader>tt', ':NvimTreeToggle<CR>')
|
||||
|
||||
vim.keymap.set('n', '<Leader>bl', ':buffers<CR>')
|
||||
|
||||
vim.cmd('colorscheme base16-material-darker')
|
||||
|
||||
require("transparent").setup({
|
||||
enable = true,
|
||||
})
|
||||
|
||||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = { "vim", "c", "lua", "kotlin", "javascript", "typescript" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
}
|
||||
}
|
||||
|
||||
require("nvim-tree").setup({
|
||||
open_on_setup = false,
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
nested = true,
|
||||
callback = function()
|
||||
if #vim.api.nvim_list_wins() == 1 and require("nvim-tree.utils").is_nvim_tree_buf() then
|
||||
vim.cmd "quit"
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'base16',
|
||||
section_separators = { left = '', right = '' }
|
||||
},
|
||||
extensions = {'nvim-tree'}
|
||||
})
|
||||
|
||||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
||||
ts_update()
|
||||
end,
|
||||
}
|
||||
use 'p00f/nvim-ts-rainbow'
|
||||
use 'jiangmiao/auto-pairs'
|
||||
use {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
requires = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
}
|
||||
}
|
||||
use 'RRethy/nvim-base16'
|
||||
use 'xiyaowong/nvim-transparent'
|
||||
end)
|
||||
|
6
nvim/lua/keybindings/init.lua
Normal file
6
nvim/lua/keybindings/init.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
vim.g.mapleader = ' '
|
||||
|
||||
vim.keymap.set('', '<Leader>ft', ':NvimTreeToggle<CR>')
|
||||
vim.keymap.set('', '<Leader>ff', ':NvimTreeFocus<CR>')
|
||||
|
||||
vim.keymap.set('n', '<Leader>bl', ':buffers<CR>')
|
1
nvim/lua/plugins/dashboard/init.lua
Normal file
1
nvim/lua/plugins/dashboard/init.lua
Normal file
|
@ -0,0 +1 @@
|
|||
local db = require('dashboard')
|
7
nvim/lua/plugins/lualine/init.lua
Normal file
7
nvim/lua/plugins/lualine/init.lua
Normal file
|
@ -0,0 +1,7 @@
|
|||
require('lualine').setup({
|
||||
options = {
|
||||
theme = 'base16',
|
||||
section_separators = { left = '', right = '' }
|
||||
},
|
||||
extensions = {'nvim-tree'}
|
||||
})
|
8
nvim/lua/plugins/nvim-tree/init.lua
Normal file
8
nvim/lua/plugins/nvim-tree/init.lua
Normal file
|
@ -0,0 +1,8 @@
|
|||
require("nvim-tree").setup({
|
||||
open_on_setup = false,
|
||||
actions = {
|
||||
open_file = {
|
||||
quit_on_open = true,
|
||||
}
|
||||
}
|
||||
})
|
40
nvim/lua/plugins/packer/init.lua
Normal file
40
nvim/lua/plugins/packer/init.lua
Normal file
|
@ -0,0 +1,40 @@
|
|||
return require('packer').startup(function(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
use {
|
||||
'glepnir/dashboard-nvim',
|
||||
config = [[require('plugins.dashboard')]]
|
||||
}
|
||||
use {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
requires = {
|
||||
'kyazdani42/nvim-web-devicons',
|
||||
'RRethy/nvim-base16'
|
||||
},
|
||||
config = [[require('plugins.lualine')]]
|
||||
}
|
||||
use {
|
||||
'xiyaowong/nvim-transparent',
|
||||
config = [[require('plugins.transparent')]]
|
||||
}
|
||||
use {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
requires = {
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
config = [[require('plugins.nvim-tree')]]
|
||||
}
|
||||
use {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
run = function()
|
||||
local ts_update = require('nvim-treesitter.install').update({ with_sync = true })
|
||||
ts_update()
|
||||
end,
|
||||
config = [[require('plugins.treesitter')]]
|
||||
}
|
||||
use 'p00f/nvim-ts-rainbow'
|
||||
use 'jiangmiao/auto-pairs'
|
||||
|
||||
if is_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
3
nvim/lua/plugins/transparent/init.lua
Normal file
3
nvim/lua/plugins/transparent/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require("transparent").setup({
|
||||
enable = true,
|
||||
})
|
12
nvim/lua/plugins/treesitter/init.lua
Normal file
12
nvim/lua/plugins/treesitter/init.lua
Normal file
|
@ -0,0 +1,12 @@
|
|||
require'nvim-treesitter.configs'.setup {
|
||||
ensure_installed = { "vim", "c", "lua", "kotlin", "javascript", "typescript" },
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
}
|
||||
}
|
|
@ -4,3 +4,5 @@ alias ytm-album="yt-dlp -x --audio-format opus -f 251 -o \"%(playlist_index)s_%(
|
|||
# copy public ip
|
||||
alias cpip="curl ifconfig.me | pbcopy"
|
||||
|
||||
# Install Nvim Packer Plugins without opening nvim
|
||||
alias packerSync="nvim --headless -c 'autocmd User PackerComplete quitall' -c 'PackerSync'"
|
||||
|
|
Loading…
Reference in a new issue