Skip to content

Commit

Permalink
Split keymaps into options and keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
cpow committed Dec 12, 2022
1 parent 259cc8e commit 7b2653c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 15 deletions.
1 change: 1 addition & 0 deletions init.lua
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
require("core.options")
require("core.keymaps")
require("core.plugins")
require("core.plugin_config")
20 changes: 5 additions & 15 deletions lua/core/keymaps.lua
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

vim.opt.backspace = '2'
vim.opt.showcmd = true
vim.opt.laststatus = 2
vim.opt.autowrite = true
vim.opt.cursorline = true
vim.opt.autoread = true

-- use spaces for tabs and whatnot
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.shiftround = true
vim.opt.expandtab = true
-- Navigate vim panes better
vim.keymap.set('n', '<c-k>', ':wincmd k<CR>')
vim.keymap.set('n', '<c-j>', ':wincmd j<CR>')
vim.keymap.set('n', '<c-h>', ':wincmd h<CR>')
vim.keymap.set('n', '<c-l>', ':wincmd l<CR>')

vim.keymap.set('n', '<leader>h', ':nohlsearch<CR>')
20 changes: 20 additions & 0 deletions lua/core/options.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
vim.g.mapleader = ' '
vim.g.maplocalleader = ' '

vim.opt.backspace = '2'
vim.opt.showcmd = true
vim.opt.laststatus = 2
vim.opt.autowrite = true
vim.opt.cursorline = true
vim.opt.autoread = true

-- use spaces for tabs and whatnot
vim.opt.tabstop = 2
vim.opt.shiftwidth = 2
vim.opt.shiftround = true
vim.opt.expandtab = true

vim.cmd [[ set noswapfile ]]

--Line numbers
vim.wo.number = true

0 comments on commit 7b2653c

Please sign in to comment.