diff options
Diffstat (limited to '.config/nvim/lua/settings.lua')
-rw-r--r-- | .config/nvim/lua/settings.lua | 100 |
1 files changed, 60 insertions, 40 deletions
diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua index 0e38be4..371cdb0 100644 --- a/.config/nvim/lua/settings.lua +++ b/.config/nvim/lua/settings.lua @@ -1,40 +1,60 @@ -vim.cmd('set iskeyword+=-') -- treat dash separated words as a word text object" -vim.cmd('set shortmess+=c') -- Don't pass messages to |ins-completion-menu|. -vim.cmd('set inccommand=split') -- Make substitution work in realtime -vim.o.hidden = O.hidden_files -- Required to keep multiple buffers open multiple buffers -vim.o.title = true -TERMINAL = vim.fn.expand('$TERMINAL') -vim.cmd('let &titleold="'..TERMINAL..'"') -vim.o.titlestring="%<%F%=%l/%L - nvim" -vim.wo.wrap = O.wrap_lines -- Display long lines as just one line -vim.cmd('set whichwrap+=<,>,[,],h,l') -- move to next line with theses keys -vim.cmd('syntax on') -- syntax highlighting -vim.o.pumheight = 10 -- Makes popup menu smaller -vim.o.fileencoding = "utf-8" -- The encoding written to file -vim.o.cmdheight = 2 -- More space for displaying messages -vim.cmd('set colorcolumn=99999') -- fix indentline for now -vim.o.mouse = "a" -- Enable your mouse -vim.o.splitbelow = true -- Horizontal splits will automatically be below -vim.o.termguicolors = true -- set term gui colors most terminals support this -vim.o.splitright = true -- Vertical splits will automatically be to the right --- vim.o.t_Co = "256" -- Support 256 colors -vim.o.conceallevel = 0 -- So that I can see `` in markdown files -vim.cmd('set ts=4') -- Insert 2 spaces for a tab -vim.cmd('set sw=4') -- Change the number of space characters inserted for indentation -vim.cmd('set expandtab') -- Converts tabs to spaces -vim.bo.smartindent = true -- Makes indenting smart -vim.wo.number = O.number -- set numbered lines -vim.wo.relativenumber = O.relative_number -- set relative number -vim.wo.cursorline = true -- Enable highlighting of the current line -vim.o.showtabline = 2 -- Always show tabs -vim.o.showmode = false -- We don't need to see things like -- INSERT -- anymore -vim.o.backup = false -- This is recommended by coc -vim.o.writebackup = false -- This is recommended by coc -vim.wo.signcolumn = "yes" -- Always show the signcolumn, otherwise it would shift the text each time -vim.o.updatetime = 300 -- Faster completion -vim.o.timeoutlen = O.timeoutlen -- By default timeoutlen is 1000 ms -vim.o.clipboard = "unnamedplus" -- Copy paste between vim and everything else -vim.g.nvim_tree_disable_netrw = O.nvim_tree_disable_netrw -- enable netrw for remote gx gf support (must be set before plugin's packadd) -vim.g.loaded_netrwPlugin = 1 -- needed for netrw gx command to open remote links in browser -vim.cmd('filetype plugin on') -- filetype detection -vim.o.guifont = "SpaceMono Nerd Font:h17" +--- HELPERS --- + +local cmd = vim.cmd +local opt = vim.opt + +--- VIM ONLY COMMANDS --- + +cmd "filetype plugin on" +cmd('let &titleold="' .. TERMINAL .. '"') +cmd "set inccommand=split" +cmd "set iskeyword+=-" +cmd "set whichwrap+=<,>,[,],h,l" +if O.transparent_window then + cmd "au ColorScheme * hi Normal ctermbg=none guibg=none" + cmd "au ColorScheme * hi SignColumn ctermbg=none guibg=none" +end + +--- COLORSCHEME --- + +vim.g.colors_name = O.colorscheme + +--- SETTINGS --- + +opt.backup = false -- creates a backup file +opt.clipboard = "unnamedplus" -- allows neovim to access the system clipboard +opt.cmdheight = 2 -- more space in the neovim command line for displaying messages +opt.colorcolumn = "99999" -- fix indentline for now +opt.completeopt = { "menuone", "noselect" } +opt.conceallevel = 0 -- so that `` is visible in markdown files +opt.fileencoding = "utf-8" -- the encoding written to a file +opt.guifont = "monospace:h17" -- the font used in graphical neovim applications +opt.hidden = O.hidden_files -- required to keep multiple buffers and open multiple buffers +opt.hlsearch = O.hl_search -- highlight all matches on previous search pattern +opt.ignorecase = O.ignore_case -- ignore case in search patterns +opt.mouse = "a" -- allow the mouse to be used in neovim +opt.pumheight = 10 -- pop up menu height +opt.showmode = false -- we don't need to see things like -- INSERT -- anymore +opt.showtabline = 2 -- always show tabs +opt.smartcase = O.smart_case -- smart case +opt.smartindent = true -- make indenting smarter again +opt.splitbelow = true -- force all horizontal splits to go below current window +opt.splitright = true -- force all vertical splits to go to the right of current window +opt.swapfile = false -- creates a swapfile +opt.termguicolors = true -- set term gui colors (most terminals support this) +opt.timeoutlen = O.timeoutlen -- time to wait for a mapped sequence to complete (in milliseconds) +opt.title = true -- set the title of window to the value of the titlestring +opt.titlestring = "%<%F%=%l/%L - nvim" -- what the title of the window will be set to +opt.undodir = CACHE_PATH .. "/undo" -- set an undo directory +opt.undofile = true -- enable persisten undo +opt.updatetime = 300 -- faster completion +opt.writebackup = false -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited +opt.expandtab = true -- convert tabs to spaces +opt.shiftwidth = 4 -- the number of spaces inserted for each indentation +opt.shortmess:append "c" +opt.tabstop = 4 -- insert 4 spaces for a tab +opt.cursorline = O.cursorline -- highlight the current line +opt.number = O.number -- set numbered lines +opt.relativenumber = O.relative_number -- set relative numbered lines +opt.signcolumn = "yes" -- always show the sign column, otherwise it would shift the text each time +opt.wrap = O.wrap_lines -- display lines as one long line |