dotfiles/nvim/init.lua

58 lines
1.3 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local options = vim.o -- For the globals options
local window_options = vim.wo -- For the window local options
local buffer_options = vim.bo -- For the buffer local options
-- window_options.colorcolumn = [[100]]
options.termguicolors = true
options.clipboard = 'unnamed,unnamedplus'
options.timeoutlen = 300
options.mouse = 'a'
options.undodir = vim.fn.expand('~/.cache/vim/undo')
options.listchars = 'tab:▸ ,extends:,precedes:'
window_options.relativenumber = true
window_options.list = true
buffer_options.autoindent = true
buffer_options.expandtab = true
buffer_options.softtabstop = 4
buffer_options.shiftwidth = 4
buffer_options.tabstop = 4
buffer_options.smartindent = true
buffer_options.modeline = true
buffer_options.undofile = true
vim.g.mapleader = ' '
-- Load utilities
require('kalle.utils')
-- Load plugins
require('kalle.plugins')
-- Load config
require('kalle.config')
vim.cmd('colorscheme nightfox')
-- TODO: Move to a better place at some point
local nvimtree = require('nvim-tree')
local nvimtree_reloaders = require('nvim-tree.actions.reloaders')
local function keepFileTree()
nvimtree_reloaders.reload_explorer()
nvimtree.open(false)
end
vim.api.nvim_create_autocmd(
"TabNewEntered",
{
pattern = "*",
callback = keepFileTree,
}
)
-- Automatically start nvim tree with vim
nvimtree.open()