Initial configuration converted to lua
Still many missing plugins and configurations
This commit is contained in:
parent
c41172efbd
commit
ec02529615
19 changed files with 137 additions and 472 deletions
4
home/.config/nvim/lua/autocmd.lua
Normal file
4
home/.config/nvim/lua/autocmd.lua
Normal file
|
@ -0,0 +1,4 @@
|
|||
local cmd = vim.cmd
|
||||
|
||||
-- Remap exit terminal mode to esc
|
||||
cmd('au TermOpen * tnoremap <buffer> <Esc> <c-\\><c-n>')
|
10
home/.config/nvim/lua/keybinds.lua
Normal file
10
home/.config/nvim/lua/keybinds.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
local map = function(type, key, value)
|
||||
vim.fn.nvim_buf_set_keymap(0, type, key, value, {noremap = true, silent = true})
|
||||
end
|
||||
|
||||
-- Open/close nerdtree
|
||||
map('n', '<C-t>', '<cmd>NERDTreeToggle<CR>')
|
||||
|
||||
-- FZF
|
||||
map('n', '<C-f>', '<cmd>Files<CR>')
|
||||
map('n', '<C-g>', '<cmd>Rg<CR>')
|
46
home/.config/nvim/lua/pluginmanager.lua
Normal file
46
home/.config/nvim/lua/pluginmanager.lua
Normal file
|
@ -0,0 +1,46 @@
|
|||
local fn = vim.fn
|
||||
local cmd = vim.cmd
|
||||
|
||||
-- Install packer if it's not yet installed
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/opt/packer.nvim'
|
||||
local packer_not_installed = fn.empty(fn.glob(install_path))
|
||||
|
||||
if packer_not_installed > 0 then
|
||||
print('Packer is not installed, cloning it now...')
|
||||
cmd ('silent !git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
|
||||
end
|
||||
|
||||
-- Configure packer
|
||||
cmd 'packadd packer.nvim'
|
||||
require('packer').startup(function()
|
||||
|
||||
-- The plugin manager itself
|
||||
use {'wbthomason/packer.nvim', opt = true}
|
||||
|
||||
-- Colorscheme
|
||||
use 'joshdick/onedark.vim'
|
||||
|
||||
-- Custom status and tabline
|
||||
use 'vim-airline/vim-airline'
|
||||
|
||||
-- Tree explorer
|
||||
use 'scrooloose/nerdtree'
|
||||
|
||||
-- Fuzzy finder
|
||||
use 'junegunn/fzf'
|
||||
use 'junegunn/fzf.vim'
|
||||
|
||||
-- Do stuff as sudo
|
||||
use 'lambdalisue/suda.vim'
|
||||
|
||||
-- Configs for built-in LSP
|
||||
use 'neovim/nvim-lspconfig'
|
||||
|
||||
-- Completion framework
|
||||
use 'nvim-lua/completion-nvim'
|
||||
end)
|
||||
|
||||
-- Install plugins if packer was not installed
|
||||
if packer_not_installed > 0 then
|
||||
cmd 'PackerInstall'
|
||||
end
|
10
home/.config/nvim/lua/plugins/airline.lua
Normal file
10
home/.config/nvim/lua/plugins/airline.lua
Normal file
|
@ -0,0 +1,10 @@
|
|||
local g = vim.g
|
||||
local o = vim.o
|
||||
|
||||
o.showmode = false
|
||||
o.laststatus = 2
|
||||
g["airline#extensions#tabline#enabled"]= 1
|
||||
g.airline_powerline_fonts = 1
|
||||
g.airline_section_warning = ''
|
||||
g.airline_section_error = ''
|
||||
g.airline_theme = 'onedark'
|
1
home/.config/nvim/lua/plugins/completion.lua
Normal file
1
home/.config/nvim/lua/plugins/completion.lua
Normal file
|
@ -0,0 +1 @@
|
|||
vim.cmd "autocmd BufEnter * lua require'completion'.on_attach()"
|
3
home/.config/nvim/lua/plugins/lsp.lua
Normal file
3
home/.config/nvim/lua/plugins/lsp.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
local cmd = vim.cmd
|
||||
|
||||
require 'lspconfig'.rust_analyzer.setup{}
|
0
home/.config/nvim/lua/plugins/nerdtree.lua
Normal file
0
home/.config/nvim/lua/plugins/nerdtree.lua
Normal file
44
home/.config/nvim/lua/settings.lua
Normal file
44
home/.config/nvim/lua/settings.lua
Normal file
|
@ -0,0 +1,44 @@
|
|||
local o = vim.o
|
||||
local cmd = vim.cmd
|
||||
|
||||
------ Appearance ------
|
||||
|
||||
-- Set colorscheme
|
||||
cmd 'colorscheme onedark'
|
||||
|
||||
-- True colors
|
||||
o.termguicolors = true
|
||||
|
||||
-- Floating window transparency
|
||||
o.winblend = 10
|
||||
|
||||
-- Remove extra line
|
||||
o.cmdheight = 1
|
||||
|
||||
-- Always show signcolumn
|
||||
o.signcolumn = 'yes'
|
||||
|
||||
-- Gutter and cursoline bg transparent
|
||||
cmd 'highlight CursorLineNr guibg=transparent'
|
||||
cmd 'highlight SignColumn guibg=transparent'
|
||||
|
||||
------ Misc -------
|
||||
|
||||
-- Case insensitive search
|
||||
o.ignorecase = true
|
||||
o.smartcase = true
|
||||
|
||||
-- Use system clipboard
|
||||
o.clipboard = 'unnamedplus'
|
||||
|
||||
-- Autoindent and syntax higlight
|
||||
o.autoindent = true
|
||||
o.smartindent = true
|
||||
o.tabstop = 4
|
||||
o.shiftwidth = 4
|
||||
cmd 'syntax on'
|
||||
cmd 'filetype on'
|
||||
cmd 'filetype plugin indent on'
|
||||
|
||||
-- Disable auto commenting
|
||||
o.formatoptions = 'cro'
|
Loading…
Add table
Add a link
Reference in a new issue