switching to nvim slowly but surely

nvim
spinach 2 years ago
parent 57d93c216d
commit db034b3e47

@ -4,3 +4,5 @@ bat
calcurse
pam-gnupg
zfxtop
nvim
lua

@ -0,0 +1,40 @@
require('keymap')
require('plugins')
require('calcurse')
-- prevent cursor override
vim.cmd('set guicursor=')
-- basic settings
vim.cmd('filetype plugin indent on')
vim.cmd('set ts=4 sts=4 sw=4 expandtab')
vim.opt.relativenumber = true
vim.opt.compatible = false
-- colorscheme and syntax settings
vim.cmd([[
syntax enable
colorscheme hybrid
hi Normal ctermbg=NONE
]])
-- defaults to transparent
transparent = true
-- timeouts
vim.opt.ttimeout = true
vim.opt.ttimeoutlen = 100
-- nvim tree basics
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- vimwiki changes
vim.cmd([[
let g:vimwiki_list = [{'path': '~/vimwiki/',
\ 'syntax': 'markdown', 'ext':'.md'}]
]])

@ -0,0 +1,7 @@
-- calcurse -> markdown
vim.api.nvim_create_autocmd({"BufRead","BufNewFile"}, {
pattern = {"/tmp/calcurse*","~/.local/share/calcurse/notes/*"},
command = "set filetype=markdown",
})

@ -0,0 +1,20 @@
require("transparent")
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>b", ":lua toggleTransparent()<CR>")
-- nvim-tree bindings
vim.keymap.set("n", "<leader>t", ":NvimTreeToggle<CR>")
vim.keymap.set("n", "<leader>s", ":lua spellToggle()<CR>")
-- toggle spell check
function spellToggle()
if vim.o.spell == nil or vim.o.spell then
vim.o.spell = false
else
vim.o.spell = true
end
end

@ -0,0 +1,12 @@
require('tree')
-- airline settings
if vim.g.airline_symbols == nil then
vim.g.airline_symbols = vim.empty_dict()
end
vim.g.airline_powerline_fonts = 1
vim.g.airline_symbols.linenr = ''
vim.g.airline_symbols.maxlinenr = ''
vim.g.airline_symbols.dirty = ''

@ -1,9 +1,10 @@
function toggleTransparent()
transparent = not transparent
if transparent then
vim.cmd("hi Normal ctermbg=NONE")
else
vim.cmd("set background=dark")
vim.cmd("syntax enable")
else
vim.cmd("hi Normal ctermbg=NONE")
end
transparent = not transparent
end

@ -0,0 +1,40 @@
require('nvim-tree').setup({
filters = {
dotfiles = true,
},
actions = {
open_file = {
quit_on_open = true,
},
},
})
showHiddenFiles = false
local function open_nvim_tree(data)
-- buffer is a directory
local directory = vim.fn.isdirectory(data.file) == 1
local empty_file = data.file == ""
print(empty_file)
if not directory and not empty_file then
return
end
if directory then
vim.cmd.cd(data.file)
end
vim.cmd.enew()
vim.cmd.bw(data.buf)
-- change to directory and open
require("nvim-tree.api").tree.open()
end
-- toggle dotfiles visibility
vim.keymap.set("n", "<leader>d", ":lua require('nvim-tree.api').tree.toggle_hidden_filter()<CR>")
-- nvim-tree open at startup
vim.api.nvim_create_autocmd({ "VimEnter" }, { callback = open_nvim_tree, })

@ -1,23 +0,0 @@
lua require('keymap')
filetype plugin indent on
set ts=4 sts=4 sw=4 expandtab
set backspace=indent,eol,start
set relativenumber
set nocompatible
syntax enable
colorscheme hybrid
" transparent settings
hi Normal ctermbg=NONE
:lua transparent = true
" calcurse notes in markdown
autocmd BufRead,BufNewFile /tmp/calcurse* set filetype=markdown
autocmd BufRead,BufNewFile ~/.local/share/calcurse/notes/* set filetype=markdown

@ -1,5 +0,0 @@
require("transparent")
vim.g.mapleader = " "
vim.keymap.set("n", "<leader>b", ":lua toggleTransparent()<CR>")

@ -0,0 +1,8 @@
vim.cmd('packadd vim-go')
vim.g.go_hightlight_types = 1
vim.g.go_hightlight_fields = 1
vim.g.go_hightlight_functions = 1
vim.g.go_hightlight_function_calls = 1
vim.g.go_hightlight_operators = 1
vim.g.go_hightlight_extra_types = 1

@ -0,0 +1,14 @@
-- adding packages
vim.cmd('packadd vim-markdown')
vim.cmd('packadd vimwiki')
-- setting spell check
vim.cmd([[
setlocal spell
setlocal wrap
]])
-- markdown plugin settings
vim.opt.conceallevel = 2
vim.g.vim_markdown_folding_disabled = 1
vim.g.vim_markdown_math = 1
vim.g.vim_markdown_strikethrough = 1

@ -0,0 +1,7 @@
- clean:
~/.config/nvim:
~/.local/share/nvim:
- link:
~/.config/nvim: editors/nvim/config
~/.local/share/nvim/site: editors/nvim/site

@ -3,6 +3,7 @@ arch.i3
arch.picom
arch.polybar
vim
nvim
zsh
oh-my-zsh
fzf

Loading…
Cancel
Save