initial nvim config
This commit is contained in:
parent
a8f3e416a8
commit
e1ab9ebdb0
3
.config/nvim/init.lua
Normal file
3
.config/nvim/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('plugins')
|
||||
require('settings')
|
||||
require('keymaps')
|
6
.config/nvim/lua/keymaps.lua
Normal file
6
.config/nvim/lua/keymaps.lua
Normal file
|
@ -0,0 +1,6 @@
|
|||
function map(mode, shortcut, command)
|
||||
vim.api.nvim_set_keymap(mode, shortcut, command, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
map('n', '<M-Left>', ':tabprevious<cr>')
|
||||
map('n', '<M-Right>', ':tabnext<cr>')
|
24
.config/nvim/lua/plugins.lua
Normal file
24
.config/nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,24 @@
|
|||
local fn = vim.fn
|
||||
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})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
end
|
||||
|
||||
require('packer').startup(function(use)
|
||||
use 'https://github.com/wbthomason/packer.nvim'
|
||||
use 'https://github.com/GuiLra/vim'
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end)
|
||||
|
||||
vim.cmd([[
|
||||
augroup packer_user_config
|
||||
autocmd!
|
||||
autocmd User PackerComplete PackerCompile
|
||||
autocmd BufWritePost plugins.lua source <afile> | PackerInstall
|
||||
augroup end
|
||||
]])
|
||||
|
11
.config/nvim/lua/settings.lua
Normal file
11
.config/nvim/lua/settings.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
vim.o.number = true -- line numbers
|
||||
vim.o.list = true -- show whitespace
|
||||
|
||||
vim.o.expandtab = true -- indent using spaces
|
||||
vim.o.tabstop = 4 -- 1 tab = 4 spaces
|
||||
vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces
|
||||
|
||||
-- theme
|
||||
vim.o.termguicolors = true
|
||||
vim.o.background = 'dark'
|
||||
vim.cmd('colorscheme omni')
|
Loading…
Reference in New Issue
Block a user