summaryrefslogtreecommitdiff
path: root/lua/core
diff options
context:
space:
mode:
Diffstat (limited to 'lua/core')
-rw-r--r--lua/core/disable_builtin.lua16
-rw-r--r--lua/core/init.lua64
2 files changed, 80 insertions, 0 deletions
diff --git a/lua/core/disable_builtin.lua b/lua/core/disable_builtin.lua
new file mode 100644
index 0000000..ea546ba
--- /dev/null
+++ b/lua/core/disable_builtin.lua
@@ -0,0 +1,16 @@
+vim.g.loaded_gzip = 1
+vim.g.loaded_zip = 1
+vim.g.loaded_zipPlugin = 1
+vim.g.loaded_tar = 1
+vim.g.loaded_tarPlugin = 1
+
+vim.g.loaded_getscript = 1
+vim.g.loaded_getscriptPlugin = 1
+vim.g.loaded_vimball = 1
+vim.g.loaded_vimballPlugin = 1
+vim.g.loaded_2html_plugin = 1
+
+vim.g.loaded_matchit = 1
+vim.g.loaded_matchparen = 1
+vim.g.loaded_logiPat = 1
+vim.g.loaded_rrhelper = 1
diff --git a/lua/core/init.lua b/lua/core/init.lua
new file mode 100644
index 0000000..1b4542a
--- /dev/null
+++ b/lua/core/init.lua
@@ -0,0 +1,64 @@
+-----------------------------------------------------------
+-- General
+-----------------------------------------------------------
+vim.opt.mouse = "a" -- Enable mouse support
+vim.opt.clipboard = "unnamedplus" -- Copy/paste to system clipboard
+vim.opt.termguicolors = true -- Enable 24-bit RGB colors
+vim.o.background = "light"
+vim.opt.hidden = true
+vim.opt.number = true
+vim.o.cursorlineopt = "both"
+vim.opt.conceallevel = 0
+vim.opt.relativenumber = true
+vim.opt.showcmd = true
+vim.opt.showmode = true
+vim.opt.colorcolumn = "80"
+vim.opt.cursorline = true
+vim.opt.foldlevelstart = 99
+vim.opt.showtabline = 1
+vim.opt.laststatus = 3 -- Single status line across all buffers
+vim.opt.undofile = true
+vim.opt.list = true -- Show some invisible characters like tabs
+vim.opt.undodir = vim.fn.stdpath("data") .. "/undo"
+vim.o.sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal"
+-- TODO make it pretty with the highlights
+--vim.opt.winbar = '%!luaeval("_winbar()")' -- The winbar text, I don't know if it is possible to embed it directly here :(
+--vim.opt.winbar = "%=%m %t%="
+-----------------------------------------------------------
+-- Tabs, indent
+-----------------------------------------------------------
+vim.opt.expandtab = true -- Use spaces instead of tabs
+vim.opt.shiftwidth = 2 -- Shift 4 spaces when tab
+vim.opt.tabstop = 2 -- 1 tab == 4 spaces
+vim.opt.smartindent = true -- Autoindent new lines
+
+-----------------------------------------------------------
+-- Custom keymaps
+-----------------------------------------------------------
+vim.api.nvim_set_keymap("i", "jk", "<Esc>", {}) -- Use jk to exit insert mode
+vim.api.nvim_set_keymap("i", "kj", "<Esc>", {}) -- Use kj to exit insert mode
+vim.api.nvim_set_keymap("t", "jk", "<Esc>", {}) -- Use jk to exit terminal mode
+vim.api.nvim_set_keymap("t", "kj", "<Esc>", {}) -- Use kj to exit terminal mode
+vim.api.nvim_set_keymap("t", "<Esc>", "<C-\\><C-n>", { noremap = true }) -- Use Esc to exit terminal mode
+
+vim.api.nvim_set_keymap("i", "<C-t>", "<Esc>:tabnew<CR>", {}) -- New tab
+vim.api.nvim_set_keymap("n", "<C-t>", ":tabnew<CR>", {}) -- New tab
+
+-- No arrow keys for movement
+--nnoremap <up> <nop>
+--nnoremap <down> <nop>
+--inoremap <up> <nop>
+--inoremap <down> <nop>
+--inoremap <left> <nop>
+--inoremap <right> <nop>
+
+--Left and right to switch buffers
+--nnoremap <left> :bp<CR>
+--nnoremap <right> :bn<CR>
+
+--_winbar = function() -- My custom winbar text
+--local filename = vim.fn.expand('%')
+--return string.gsub(filename, 'term://.*:', '')
+--end
+
+require("core.disable_builtin")