aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/settings.lua
diff options
context:
space:
mode:
authorAlec Goncharow <algo@cloudflare.com>2023-02-24 23:20:34 -0600
committerAlec Goncharow <algo@cloudflare.com>2023-02-24 23:20:34 -0600
commit0c446121ba1f1653a0d984068209429e8cc453fb (patch)
treebc04e8bb2a985e5cb4f7b15c1e4d8962b2c4b000 /.config/nvim/lua/settings.lua
parentd3aeb8f7d8d9b4352e7b827a361d1da11cb6cf04 (diff)
out of the frying pan
into the fire
Diffstat (limited to '.config/nvim/lua/settings.lua')
-rw-r--r--.config/nvim/lua/settings.lua88
1 files changed, 88 insertions, 0 deletions
diff --git a/.config/nvim/lua/settings.lua b/.config/nvim/lua/settings.lua
new file mode 100644
index 0000000..cae0968
--- /dev/null
+++ b/.config/nvim/lua/settings.lua
@@ -0,0 +1,88 @@
+HOME = os.getenv("HOME")
+
+vim.g.mapleader = ' '
+
+-- basic settings
+vim.o.encoding = "utf-8"
+vim.o.backspace = "indent,eol,start" -- backspace works on every char in insert mode
+vim.o.completeopt = 'menuone,noselect'
+vim.o.history = 1000
+vim.o.dictionary = '/usr/share/dict/words'
+vim.o.startofline = true
+
+-- Mapping waiting time
+vim.o.timeout = false
+vim.o.ttimeout = true
+vim.o.ttimeoutlen = 100
+
+-- Display
+vim.o.showmatch = true -- show matching brackets
+vim.o.scrolloff = 3 -- always show 3 rows from edge of the screen
+vim.o.synmaxcol = 300 -- stop syntax highlight after x lines for performance
+vim.o.laststatus = 2 -- always show status line
+
+vim.o.list = false -- do not display white characters
+vim.o.foldenable = false
+vim.o.foldlevel = 4 -- limit folding to 4 levels
+vim.o.foldmethod = 'syntax' -- use language syntax to generate folds
+vim.o.wrap = false --do not wrap lines even if very long
+vim.o.eol = false -- show if there's no eol char
+vim.o.showbreak= '↪' -- character to show when line is broken
+
+-- Sidebar
+vim.o.number = true -- line number on the left
+vim.o.numberwidth = 3 -- always reserve 3 spaces for line number
+vim.o.signcolumn = 'yes' -- keep 1 column for coc.vim check
+vim.o.modelines = 0
+vim.o.showcmd = true -- display command in bottom bar
+
+-- Search
+vim.o.incsearch = true -- starts searching as soon as typing, without enter needed
+vim.o.ignorecase = true -- ignore letter case when searching
+vim.o.smartcase = true -- case insentive unless capitals used in search
+
+vim.o.matchtime = 2 -- delay before showing matching paren
+vim.o.mps = vim.o.mps .. ",<:>"
+
+-- White characters
+vim.o.autoindent = true
+vim.o.smartindent = true
+vim.o.tabstop = 2 -- 1 tab = 2 spaces
+vim.o.shiftwidth = 2 -- indentation rule
+vim.o.formatoptions = 'qnj1' -- q - comment formatting; n - numbered lists; j - remove comment when joining lines; 1 - don't break after one-letter word
+vim.o.expandtab = true -- expand tab to spaces
+
+-- Backup files
+vim.o.backup = true -- use backup files
+vim.o.writebackup = false
+vim.o.swapfile = false -- do not use swap file
+vim.o.undodir = HOME .. '/.vim/tmp/undo//' -- undo files
+vim.o.backupdir = HOME .. '/.vim/tmp/backup//' -- backups
+vim.o.directory = '/.vim/tmp/swap//' -- swap files
+
+vim.cmd([[
+
+
+ au FileType python set ts=4 sw=4
+ au BufRead,BufNewFile *.md set ft=mkd tw=80 syntax=markdown
+ au BufRead,BufNewFile *.ppmd set ft=mkd tw=80 syntax=markdown
+ au BufRead,BufNewFile *.markdown set ft=mkd tw=80 syntax=markdown
+ au BufRead,BufNewFile *.slimbars set syntax=slim
+]])
+
+vim.cmd('colorscheme gruvbox')
+vim.cmd([[
+" ### Transparency ###
+hi Normal guibg=none ctermbg=none
+hi LineNr guibg=none ctermbg=none
+hi Folded guibg=none ctermbg=none
+hi NonText guibg=none ctermbg=none
+hi SpecialKey guibg=none ctermbg=none
+hi VertSplit guibg=none ctermbg=none
+hi SignColumn guibg=none ctermbg=none
+hi EndOfBuffer guibg=none ctermbg=none
+]])
+
+-- Commands mode
+vim.o.wildmenu = true -- on TAB, complete options for system command
+vim.o.wildignore = 'deps,.svn,CVS,.git,.hg,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,.DS_Store,*.aux,*.out,*.toc'