nvim: cleanup
This commit is contained in:
parent
2f02c47ef0
commit
e36365b4e8
|
@ -9,14 +9,13 @@ packer.use {
|
||||||
require'nvim-treesitter.configs'.setup {
|
require'nvim-treesitter.configs'.setup {
|
||||||
highlight = {
|
highlight = {
|
||||||
enable = true,
|
enable = true,
|
||||||
additional_vim_regex_highlighting = {'org'}
|
additional_vim_regex_highlighting = { 'org' }
|
||||||
},
|
},
|
||||||
ensure_installed = {'org'},
|
ensure_installed = { 'org' },
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
-- org
|
|
||||||
packer.use {
|
packer.use {
|
||||||
'https://github.com/nvim-orgmode/orgmode',
|
'https://github.com/nvim-orgmode/orgmode',
|
||||||
requires = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
requires = 'https://github.com/nvim-treesitter/nvim-treesitter',
|
||||||
|
|
|
@ -8,26 +8,26 @@ vim.g.maplocalleader = ' ' -- <LocalLeader> (2 spaces)
|
||||||
local format = string.format
|
local format = string.format
|
||||||
|
|
||||||
-- buffers
|
-- buffers
|
||||||
map('n', '<Leader>b', ':buffers<CR>:buffer<Space>')
|
map('n', '<Leader>b', ':buffers<CR>:buffer<Space>')
|
||||||
for key, cmd in pairs({ Left = 'bprevious', Right = 'bnext' }) do
|
for key, cmd in pairs({ Left = 'bprevious', Right = 'bnext' }) do
|
||||||
map('n', format('<M-%s>', key), format(':%s<cr>', cmd))
|
map('n', format('<M-%s>', key), format(':%s<cr>', cmd))
|
||||||
map('i', format('<M-%s>', key), format('<esc>:%s<cr>', cmd))
|
map('i', format('<M-%s>', key), format('<esc>:%s<cr>', cmd))
|
||||||
end
|
end
|
||||||
-- move buffer without moving cursor
|
---- move buffer without moving cursor
|
||||||
map({ 'n', 'v' }, '<M-Up>', '<C-y>')
|
map({ 'n', 'v' }, '<M-Up>', '<C-y>')
|
||||||
map({ 'n', 'v' }, '<M-Down>', '<C-e>')
|
map({ 'n', 'v' }, '<M-Down>', '<C-e>')
|
||||||
|
|
||||||
--windows
|
-- windows
|
||||||
for key, letter in pairs({ Left = 'h', Down = 'j', Up = 'k', Right = 'l' }) do
|
for key, letter in pairs({ Left = 'h', Down = 'j', Up = 'k', Right = 'l' }) do
|
||||||
map('n', format('<M-S-%s>', key), format(':wincmd %s<cr>', letter))
|
map('n', format('<M-S-%s>', key), format(':wincmd %s<cr>', letter))
|
||||||
map('i', format('<M-S-%s>', key), format('<esc>:wincmd %s<cr>', letter))
|
map('i', format('<M-S-%s>', key), format('<esc>:wincmd %s<cr>', letter))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- remove word
|
-- remove word
|
||||||
map('n', '<M-BS>', 'db')
|
map('n', '<M-BS>', 'db')
|
||||||
vim.cmd([[map! <M-BS> <C-W>]]) -- TODO: figure out how to do that with lua
|
vim.cmd([[map! <M-BS> <C-W>]]) -- TODO: figure out how to do that with lua
|
||||||
map('n', '<C-Del>', 'dw')
|
map('n', '<C-Del>', 'dw')
|
||||||
map('i', '<C-Del>', '<C-O>dw')
|
map('i', '<C-Del>', '<C-O>dw')
|
||||||
|
|
||||||
-- remove whitespace around cursor
|
-- remove whitespace around cursor
|
||||||
map({ 'n', 'i' }, '<C-S-Del>',
|
map({ 'n', 'i' }, '<C-S-Del>',
|
||||||
|
@ -75,8 +75,8 @@ map({ 'n', 'v' }, '<C-F>', '==') -- re-indent line
|
||||||
|
|
||||||
-- select text with shift + arrow
|
-- select text with shift + arrow
|
||||||
for _, key in ipairs({ 'Left', 'Up', 'Down', 'Right' }) do
|
for _, key in ipairs({ 'Left', 'Up', 'Down', 'Right' }) do
|
||||||
map({ 'n', 'i' }, format('<S-%s>', key), format('<Esc>v<%s>', key))
|
map({ 'n', 'i' }, format('<S-%s>', key), format('<Esc>v<%s>', key))
|
||||||
map({ 'v' }, format('<S-%s>', key), format('<%s>', key))
|
map({ 'v' }, format('<S-%s>', key), format('<%s>', key))
|
||||||
end
|
end
|
||||||
|
|
||||||
map('n', '<F9>', ':Lexplore 20<cr>') -- file explorer, 20% width
|
map('n', '<F9>', ':Lexplore 20<cr>') -- file explorer, 20% width
|
||||||
|
|
|
@ -8,7 +8,7 @@ vim.o.linebreak = true -- break on word boundaries
|
||||||
|
|
||||||
vim.o.cursorline = true -- highlight row with cursor
|
vim.o.cursorline = true -- highlight row with cursor
|
||||||
vim.o.scrolloff = 5 -- show 5 lines below/above cursor
|
vim.o.scrolloff = 5 -- show 5 lines below/above cursor
|
||||||
vim.o.sidescrolloff = 5 -- same fore left/right
|
vim.o.sidescrolloff = 5 -- same for left/right
|
||||||
vim.o.expandtab = true -- indent using spaces
|
vim.o.expandtab = true -- indent using spaces
|
||||||
vim.o.tabstop = 4 -- 1 tab = 4 spaces
|
vim.o.tabstop = 4 -- 1 tab = 4 spaces
|
||||||
vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces
|
vim.o.shiftwidth = 4 -- 1 indentation = 4 spaces
|
||||||
|
@ -16,11 +16,10 @@ vim.o.completeopt = 'menu,menuone,noselect' -- completion popup
|
||||||
vim.o.autochdir = true -- change workir to current file dir
|
vim.o.autochdir = true -- change workir to current file dir
|
||||||
vim.o.updatetime = 500 -- fire CursorHold autocommand event
|
vim.o.updatetime = 500 -- fire CursorHold autocommand event
|
||||||
vim.o.cmdheight = 2 -- message area size
|
vim.o.cmdheight = 2 -- message area size
|
||||||
-- vim.o.mouse = 'nv' -- make use of mouse in these modes
|
vim.o.mouse = '' -- make use of mouse in these modes
|
||||||
vim.o.pumheight = 10 -- maximum entries in popup menu
|
vim.o.pumheight = 10 -- maximum entries in popup menu
|
||||||
vim.o.smartindent = true -- indent after { and so on
|
vim.o.smartindent = true -- indent after { and so on
|
||||||
|
|
||||||
|
|
||||||
-- theme
|
-- theme
|
||||||
vim.o.termguicolors = true -- 24 bit colours
|
vim.o.termguicolors = true -- 24 bit colours
|
||||||
packer.use {
|
packer.use {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user