feat(nvim): automatically resize panes
This commit is contained in:
parent
0eebf0709f
commit
b71b89323d
roles/neovim/files/lua/opdavies
|
@ -12,6 +12,12 @@ local function set_autocmd()
|
||||||
autocmd FileType gitcommit setlocal spell
|
autocmd FileType gitcommit setlocal spell
|
||||||
autocmd FileType gitcommit setlocal textwidth=72
|
autocmd FileType gitcommit setlocal textwidth=72
|
||||||
]]
|
]]
|
||||||
|
|
||||||
|
-- Automatically resize buffers when Vim is resized.
|
||||||
|
vim.api.nvim_create_autocmd(
|
||||||
|
"VimResized *",
|
||||||
|
{ command = ":wincmd =" }
|
||||||
|
)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_filetypes()
|
local function set_filetypes()
|
||||||
|
@ -54,9 +60,10 @@ local function set_key_mappings()
|
||||||
|
|
||||||
map("n", "<C-f>", ":silent !tmux neww tmux-sessioniser<CR>", { noremap = true, silent = true })
|
map("n", "<C-f>", ":silent !tmux neww tmux-sessioniser<CR>", { noremap = true, silent = true })
|
||||||
|
|
||||||
local imap = require "opdavies.keymap".imap
|
local keymap = require "opdavies.keymap"
|
||||||
local nmap = require "opdavies.keymap".nmap
|
local imap = keymap.imap
|
||||||
local xmap = require "opdavies.keymap".xmap
|
local nmap = keymap.nmap
|
||||||
|
local xmap = keymap.xmap
|
||||||
|
|
||||||
-- Easy insertion of a trailing ; or , from insert mode
|
-- Easy insertion of a trailing ; or , from insert mode
|
||||||
imap { ",,", "<Esc>A,<Esc>" }
|
imap { ",,", "<Esc>A,<Esc>" }
|
||||||
|
@ -64,6 +71,12 @@ local function set_key_mappings()
|
||||||
|
|
||||||
nmap { "ga", "<Plug>(EasyAlign)" }
|
nmap { "ga", "<Plug>(EasyAlign)" }
|
||||||
xmap { "ga", "<Plug>(EasyAlign)" }
|
xmap { "ga", "<Plug>(EasyAlign)" }
|
||||||
|
|
||||||
|
-- Focus on the current buffer.
|
||||||
|
nmap { "<leader>-", ":wincmd _<cr>:wincmd |<cr>", { noremap = true, silent = true }}
|
||||||
|
|
||||||
|
-- Automatically resize buffers.
|
||||||
|
nmap { "<leader>=", ":wincmd =<cr>", { noremap = true, silent = true }}
|
||||||
end
|
end
|
||||||
|
|
||||||
local function set_highlights()
|
local function set_highlights()
|
||||||
|
|
|
@ -25,7 +25,6 @@ return packer.startup(function()
|
||||||
use "cakebaker/scss-syntax.vim"
|
use "cakebaker/scss-syntax.vim"
|
||||||
use "christoomey/vim-sort-motion"
|
use "christoomey/vim-sort-motion"
|
||||||
use "christoomey/vim-tmux-navigator"
|
use "christoomey/vim-tmux-navigator"
|
||||||
use "dhruvasagar/vim-zoom"
|
|
||||||
use "editorconfig/editorconfig-vim"
|
use "editorconfig/editorconfig-vim"
|
||||||
use "folke/twilight.nvim"
|
use "folke/twilight.nvim"
|
||||||
use "folke/zen-mode.nvim"
|
use "folke/zen-mode.nvim"
|
||||||
|
|
Loading…
Reference in a new issue