move all configs to lua

This commit is contained in:
Felix Suchert 2023-06-06 21:49:25 +02:00
parent 4150497767
commit 19ac4c30c0
Signed by: feliix42
GPG key ID: 24363525EA0E8A99
2 changed files with 94 additions and 37 deletions

View file

@ -5,7 +5,9 @@ vim.g.mapleader = ","
-- load legacy options -- load legacy options
vim.cmd([[ vim.cmd([[
so ~/.config/nvim/legacy.vim " so ~/.config/nvim/legacy.vim
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden'
let g:tex_flavor='latex'
]]) ]])
require('completion') require('completion')
@ -47,3 +49,58 @@ require("bufferline").setup{}
if vim.g.neovide then if vim.g.neovide then
vim.o.guifont = "Iosevka Term Medium:h12" vim.o.guifont = "Iosevka Term Medium:h12"
end end
vim.opt.backspace = "indent,eol,start"
-- fix auto-completion
vim.opt.wildmenu = true
vim.opt.wildignorecase = true
vim.opt.wildignore = "*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,*.toc,*.nav,*.snm"
-- BUFFER HANDLING ---------------------------------
-- automatically reload files changed on disk but not in buffer
vim.opt.autoread = true
-- hide buffers on switch
vim.opt.hidden = true
-- OPTICS & NUMBERING BEHAVIOUR --------------------
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- keep 5 lines of context above/below the cursor (if possible)
vim.opt.scrolloff = 5
-- SEARCH ------------------------------------------
-- highlight all search results
vim.opt.hlsearch = true
-- enable smart-case search
vim.opt.smartcase = true
-- always case-insensitive
vim.opt.ignorecase = true
-- searches for strings incrementally
vim.opt.incsearch = true
-- key bindings
-- empty mode string matches n, v, o
vim.keymap.set("", "<leader>h", ":tabp<Enter>", { desc = "Select previous tab" })
vim.keymap.set("", "<leader>l", ":tabn<Enter>", { desc = "Select next tab" })
vim.keymap.set("", "<C-H>", ":bprevious<Enter>", { desc = "Select previous buffer" })
vim.keymap.set("", "<C-L>", ":bnext<Enter>", { desc = "Select next buffer" })
vim.keymap.set("", "<leader>f", ":Files<Enter>", { desc = "Open FZF file finder" })
vim.keymap.set("", "<leader>bl", ":Buffers<Enter>", { desc = "Open FZF buffer list" })
vim.keymap.set("n", "<space>1", "1<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>2", "2<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>3", "3<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>4", "4<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>5", "5<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>6", "6<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>7", "7<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>8", "8<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>9", "9<C-w>w", { noremap = true })
vim.keymap.set("n", "<space>0", "10<C-w>w", { noremap = true })

View file

@ -58,23 +58,23 @@
" window switching by # " window switching by #
"let g:airline_section_c = '[%{winnr()}] %t' "let g:airline_section_c = '[%{winnr()}] %t'
nnoremap <space>1 1<C-w>w "nnoremap <space>1 1<C-w>w
nnoremap <space>2 2<C-w>w "nnoremap <space>2 2<C-w>w
nnoremap <space>3 3<C-w>w "nnoremap <space>3 3<C-w>w
nnoremap <space>4 4<C-w>w "nnoremap <space>4 4<C-w>w
nnoremap <space>5 5<C-w>w "nnoremap <space>5 5<C-w>w
nnoremap <space>6 6<C-w>w "nnoremap <space>6 6<C-w>w
nnoremap <space>7 7<C-w>w "nnoremap <space>7 7<C-w>w
nnoremap <space>8 8<C-w>w "nnoremap <space>8 8<C-w>w
nnoremap <space>9 9<C-w>w "nnoremap <space>9 9<C-w>w
nnoremap <space>0 10<C-w>w "nnoremap <space>0 10<C-w>w
" possible setting as alternative for easymotion " possible setting as alternative for easymotion
" let g:sneak#label = 1 " let g:sneak#label = 1
set backspace=indent,eol,start "set backspace=indent,eol,start
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden' "let $FZF_DEFAULT_COMMAND = 'rg --files --hidden'
" Cycling through windows and tabs " Cycling through windows and tabs
" nnoremap j <C-W><C-J> " nnoremap j <C-W><C-J>
@ -85,42 +85,42 @@ let $FZF_DEFAULT_COMMAND = 'rg --files --hidden'
" nnoremap <C-K> <C-W><C-K><C-W>_ " nnoremap <C-K> <C-W><C-K><C-W>_
" nnoremap <C-L> <C-W><C-L><C-W>\| " nnoremap <C-L> <C-W><C-L><C-W>\|
" nnoremap <C-H> <C-W><C-H><C-W>\| " nnoremap <C-H> <C-W><C-H><C-W>\|
map <leader>h :tabp<Enter> "map <leader>h :tabp<Enter>
map <leader>l :tabn<Enter> "map <leader>l :tabn<Enter>
map <C-H> :bprevious<Enter> "map <C-H> :bprevious<Enter>
map <C-L> :bnext<Enter> "map <C-L> :bnext<Enter>
map <leader>f :Files<Enter> "map <leader>f :Files<Enter>
map <leader>bl :Buffers<Enter> "map <leader>bl :Buffers<Enter>
" fix auto-completion " fix auto-completion
set wildmenu " show a completion menu "set wildmenu " show a completion menu
set wildignorecase "set wildignorecase
set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml, "set wildignore=*.o,*~,*.pyc,*.aux,*.bbl,*.blg,*-blx.bib,*.log,*.out,*.run.xml,
\*.toc,*.nav,*.snm " ignore auxiliary files "\*.toc,*.nav,*.snm " ignore auxiliary files
" set completeopt-=preview " set completeopt-=preview
" automatically reload files changed on disk but not in buffer " automatically reload files changed on disk but not in buffer
set autoread "set autoread
" hide buffers on switch " hide buffers on switch
set hidden "set hidden
" tex configuration " tex configuration
let g:tex_flavor='latex' "let g:tex_flavor='latex'
" Optics " Optics
"colorscheme palenight "gruvbox "colorscheme palenight "gruvbox
"set background=dark " Setting dark mode "set background=dark " Setting dark mode
set number "set number
set relativenumber "set relativenumber
set tabstop=4 "set tabstop=4
set shiftwidth=4 "set shiftwidth=4
set expandtab "set expandtab
" keep 5 lines of context above/below the cursor (if possible) " keep 5 lines of context above/below the cursor (if possible)
set scrolloff=5 "set scrolloff=5
" Search "" Search
set hlsearch " Highlight all search results "set hlsearch " Highlight all search results
set smartcase " Enable smart-case search "set smartcase " Enable smart-case search
set ignorecase " Always case-insensitive "set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally "set incsearch " Searches for strings incrementally