parent
a282cf4d63
commit
8789a2a83e
33 changed files with 37 additions and 24 deletions
3
cli/.config/nvim/init.lua
Normal file
3
cli/.config/nvim/init.lua
Normal file
|
@ -0,0 +1,3 @@
|
|||
require('settings')
|
||||
require('maps')
|
||||
require('plugins')
|
31
cli/.config/nvim/lua/maps.lua
Normal file
31
cli/.config/nvim/lua/maps.lua
Normal file
|
@ -0,0 +1,31 @@
|
|||
vim.g.mapleader = ' '
|
||||
|
||||
function unmap(key)
|
||||
vim.api.nvim_set_keymap('', key, '', {})
|
||||
end
|
||||
function map(mode, key, action)
|
||||
vim.api.nvim_set_keymap(mode, key, action, {noremap = true})
|
||||
end
|
||||
|
||||
-- some unmaps
|
||||
unmap(' ')
|
||||
unmap('q')
|
||||
unmap('<F1>')
|
||||
|
||||
-- option control
|
||||
map('n', '<Leader>c', ':setlocal cursorline!<CR>')
|
||||
map('n', '<Leader>l', ':setlocal list!<CR>')
|
||||
map('n', '<Leader>w', ':setlocal wrap!<CR>')
|
||||
|
||||
-- search
|
||||
map('n', '<Leader>/', ':noh<CR>')
|
||||
|
||||
-- copy / paste
|
||||
map('n', '<Leader>y', '"+y')
|
||||
map('n', '<Leader>d', '"+d')
|
||||
map('n', '<Leader>p', '"+p')
|
||||
map('n', '<Leader>P', '"+P')
|
||||
|
||||
-- keymap switch
|
||||
map('!', '<C-Space>', '<C-^>')
|
||||
map('!', '<C-@>', '<C-^>')
|
23
cli/.config/nvim/lua/packer_init.lua
Normal file
23
cli/.config/nvim/lua/packer_init.lua
Normal file
|
@ -0,0 +1,23 @@
|
|||
local packer_init = {}
|
||||
|
||||
packer_init.init = function(plugins)
|
||||
local ensure_packer = function()
|
||||
local install_path = vim.fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
vim.fn.system {'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path}
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
require('packer').startup(plugins)
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
return packer_init
|
43
cli/.config/nvim/lua/plugins.lua
Normal file
43
cli/.config/nvim/lua/plugins.lua
Normal file
|
@ -0,0 +1,43 @@
|
|||
-- [[ plugins list ]]
|
||||
local function plugins(use)
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
use 'lifepillar/vim-gruvbox8'
|
||||
use 'hoob3rt/lualine.nvim'
|
||||
use 'hashivim/vim-terraform'
|
||||
use 'mhinz/vim-signify'
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-rsi'
|
||||
use 'tpope/vim-vinegar'
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'nvim-telescope/telescope.nvim'
|
||||
use {
|
||||
'w0rp/ale',
|
||||
ft = { 'sh', 'zsh', 'lua', 'python' },
|
||||
cmd = 'ALEEnable'
|
||||
}
|
||||
end
|
||||
|
||||
--[[ init plugins and install packer if missing ]]
|
||||
if require('packer_init').init(plugins) then return end
|
||||
|
||||
--[[ plugins config ]]
|
||||
require('lualine').setup{
|
||||
options = {
|
||||
icons_enabled = false,
|
||||
component_separators = { left = '\u{2022}', right = '\u{2022}' }
|
||||
}
|
||||
}
|
||||
|
||||
--[[ telescope maps ]]
|
||||
map('n', '<Leader>.', '<cmd>Telescope find_files<CR>')
|
||||
map('n', '<Leader>,', '<cmd>Telescope buffers<CR>')
|
||||
|
||||
--[[ theme ]]
|
||||
vim.o.bg = 'dark'
|
||||
vim.o.termguicolors = true
|
||||
|
||||
vim.g.gruvbox_plugin_hi_groups = 1
|
||||
vim.g.gruvbox_filetype_hi_groups = 1
|
||||
|
||||
vim.cmd [[colorscheme gruvbox8]]
|
34
cli/.config/nvim/lua/settings.lua
Normal file
34
cli/.config/nvim/lua/settings.lua
Normal file
|
@ -0,0 +1,34 @@
|
|||
local fsize = '11'
|
||||
if vim.loop.os_uname().sysname == 'Darwin' then fsize = '14' end
|
||||
|
||||
vim.o.modeline = false
|
||||
vim.o.foldmethod = 'marker'
|
||||
vim.o.cursorline = true
|
||||
vim.o.colorcolumn = '80'
|
||||
vim.o.relativenumber = true
|
||||
vim.o.breakindent = true
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
|
||||
vim.o.list = true
|
||||
vim.o.listchars = 'tab:==>,nbsp:x,trail:*'
|
||||
|
||||
vim.o.ignorecase = true
|
||||
vim.o.smartcase = true
|
||||
|
||||
vim.o.scrolloff = 3
|
||||
vim.o.sidescrolloff = 15
|
||||
|
||||
vim.o.tabstop = 3
|
||||
vim.o.softtabstop = 4
|
||||
vim.o.shiftwidth = 4
|
||||
vim.o.expandtab = true
|
||||
|
||||
vim.o.keymap = 'russian-jcukenwintype'
|
||||
vim.o.iminsert = 0
|
||||
vim.o.imsearch = 0
|
||||
|
||||
vim.o.title = true
|
||||
vim.o.titlestring = '[%{hostname()}] %t - neovim'
|
||||
vim.o.statusline = '[%F] %R%H%W%M %=[%{&fenc}/%{&ff}] %y [%4l/%L:%3v]'
|
||||
|
||||
vim.o.guifont = 'vcascadia:h' .. fsize
|
Loading…
Add table
Add a link
Reference in a new issue