Rewrite Neovim config

This commit is contained in:
Nikurasu 2022-12-23 10:15:39 +01:00
parent e3afc7c531
commit b8c03461bb
11 changed files with 193 additions and 59 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.DS_Store

View file

@ -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
View 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)

View 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>')

View file

@ -0,0 +1 @@
local db = require('dashboard')

View file

@ -0,0 +1,7 @@
require('lualine').setup({
options = {
theme = 'base16',
section_separators = { left = '', right = '' }
},
extensions = {'nvim-tree'}
})

View file

@ -0,0 +1,8 @@
require("nvim-tree").setup({
open_on_setup = false,
actions = {
open_file = {
quit_on_open = true,
}
}
})

View 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)

View file

@ -0,0 +1,3 @@
require("transparent").setup({
enable = true,
})

View 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,
}
}

View file

@ -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'"