diff options
author | Christian Segundo | 2024-02-18 08:19:51 +0100 |
---|---|---|
committer | Christian Segundo | 2024-02-18 08:19:51 +0100 |
commit | 85d7d7c082bd84d3c701ceec3d477ee37db5c827 (patch) | |
tree | b78f09285c5120783f94cf9c2465a46439af2b71 /lua/core/init.lua | |
parent | 7869bf2c310fbed680abd01d45a17057f857bf30 (diff) | |
download | config-85d7d7c082bd84d3c701ceec3d477ee37db5c827.tar.gz |
bootstrap
Diffstat (limited to 'lua/core/init.lua')
-rw-r--r-- | lua/core/init.lua | 64 |
1 files changed, 64 insertions, 0 deletions
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") |