chg: Tidy things up, convert more stuff to lua, and switch to lualine

This commit is contained in:
Sayantan Santra 2024-03-20 20:00:52 -05:00
parent 7790f502b2
commit ec8547fe83
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F
23 changed files with 94 additions and 333 deletions

View file

@ -30,3 +30,7 @@ nnoremap <leader>u <c-r>
" Find files using fzf by ,f " Find files using fzf by ,f
nnoremap <leader>f :Files<CR> nnoremap <leader>f :Files<CR>
" Move around buffers using ,j and ,k
nnoremap <leader>k :bnext<CR>
nnoremap <leader>k :bprevious<CR>

View file

@ -24,9 +24,9 @@ end
bootstrap_paq { bootstrap_paq {
-- Let paq-nvim manage itself -- Let paq-nvim manage itself
"savq/paq-nvim", "savq/paq-nvim",
-- airline related plugins -- Use lualine for statusbar
"vim-airline/vim-airline", "nvim-lualine/lualine.nvim",
"vim-airline/vim-airline-themes", "nvim-tree/nvim-web-devicons",
-- Auto commenting per filetype -- Auto commenting per filetype
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
-- Give option to save files using sudo, if needed -- Give option to save files using sudo, if needed

View file

@ -1,50 +0,0 @@
" enable tabline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''
" air-line
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
" Switch to your current theme
let g:airline_theme = 'moonfly'
" Always show tabs
set showtabline=2
" We don't need to see things like -- INSERT -- anymore
set noshowmode
" Navigate tabs using ,j and ,k
nnoremap <Leader>k :bnext<CR>
nnoremap <Leader>j :bprevious<CR>

13
laptop/plugin/lualine.lua Normal file
View file

@ -0,0 +1,13 @@
require("lualine").setup{
options = {
theme = 'moonfly',
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {'filename'},
lualine_z = {'tabs'},
},
}

5
laptop/plugin/suda.lua Normal file
View file

@ -0,0 +1,5 @@
-- Disable Suda in diff views
if not vim.api.nvim_win_get_option(0, 'diff') then
vim.g.suda_smart_edit = 1
end

View file

@ -1,4 +0,0 @@
if ! &diff
let g:suda_smart_edit = 1
endif

23
laptop/plugin/vimtex.lua Normal file
View file

@ -0,0 +1,23 @@
-- Enable languagetool support using YaLafi
vim.g.vimtex_grammar_vlty = { lt_command = "languagetool" }
-- Compile once by ;lo and also add proper line-breaking
vim.api.nvim_create_autocmd(
'FileType', {
desc = 'Compile once by <localleader>lo and also add proper line-breaking',
pattern = 'tex',
group = vim.api.nvim_create_augroup('vimrc_tex', {}),
callback = function()
vim.keymap.set('n', '<localleader>lo', ":silent VimtexCompileSS<cr>", {buffer = true })
vim.opt.linebreak = true
vim.opt.tw = 140
end,
}
)
-- Use zathura with vimtex, the zathura_simple one makes synctex work in Wayland
vim.g.vimtex_view_method = 'zathura_simple'
-- Use a temporary directory for aux files
vim.g.vimtex_compiler_latexmk = { aux_dir = "/tmp/latexmk" }

View file

@ -1,27 +0,0 @@
" Automatically start continuous compilation
" augroup vimtex_config
" autocmd User VimtexEventInitPost VimtexCompile
" augroup END
" Enable languagetool support using YaLafi
let g:vimtex_grammar_vlty = {'lt_command': 'languagetool'}
set spelllang=en_us
" Compile once by \lo
augroup vimrc_tex
autocmd!
autocmd FileType tex nnoremap <buffer> <localleader>lo :silent VimtexCompileSS<CR>
augroup END
" Enable word wrapping for tex files
" autocmd FileType tex :set wrap
autocmd FileType tex :set linebreak
autocmd FileType tex :set tw=140
" Use zathura with vimtex, the zathura_simple one makes synctex work in
" Wayland
let g:vimtex_view_method = 'zathura_simple'
" Use a temporary directory for aux files
let g:vimtex_compiler_latexmk = { 'aux_dir' : '/tmp/latexmk' }

View file

@ -15,3 +15,7 @@ nnoremap <Leader>O O<Esc>j
" Use ,u for redo " Use ,u for redo
nnoremap <Leader>u <c-r> nnoremap <Leader>u <c-r>
" Move around buffers using ,j and ,k
nnoremap <leader>k :bnext<CR>
nnoremap <leader>k :bprevious<CR>

View file

@ -24,9 +24,9 @@ end
bootstrap_paq { bootstrap_paq {
-- Let paq-nvim manage itself -- Let paq-nvim manage itself
"savq/paq-nvim", "savq/paq-nvim",
-- airline related plugins -- Use lualine for statusbar
"vim-airline/vim-airline", "nvim-lualine/lualine.nvim",
"vim-airline/vim-airline-themes", "nvim-tree/nvim-web-devicons",
-- Auto commenting per filetype -- Auto commenting per filetype
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
-- Give option to save files using sudo, if needed -- Give option to save files using sudo, if needed

View file

@ -1,45 +0,0 @@
" enable tabline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''
" air-line
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
" Switch to your current theme
let g:airline_theme = 'moonfly'
" Always show tabs
set showtabline=2
" We don't need to see things like -- INSERT -- anymore
set noshowmode

View file

@ -1,61 +0,0 @@
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
completion = cmp.config.window.bordered(winhighlight),
documentation = cmp.config.window.bordered(winhighlight),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {{ name = 'buffer' }}
),
experimental = { ghost_text = true },
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

13
server/plugin/lualine.lua Normal file
View file

@ -0,0 +1,13 @@
require("lualine").setup{
options = {
theme = 'moonfly',
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {'filename'},
lualine_z = {'tabs'},
},
}

View file

@ -1,11 +0,0 @@
require'lspconfig'.pyright.setup({
on_attach = on_attach,
flags = lsp_flags,
settings = {
python = {
analysis = {
typeCheckingMode = "off"
}
}
}
})

5
server/plugin/suda.lua Normal file
View file

@ -0,0 +1,5 @@
-- Disable Suda in diff views
if not vim.api.nvim_win_get_option(0, 'diff') then
vim.g.suda_smart_edit = 1
end

View file

@ -1,3 +0,0 @@
if ! &diff
let g:suda_smart_edit = 1
endif

View file

@ -24,18 +24,15 @@ end
bootstrap_paq { bootstrap_paq {
-- Let paq-nvim manage itself -- Let paq-nvim manage itself
"savq/paq-nvim", "savq/paq-nvim",
-- airline related plugins -- Use lualine for statusbar
"vim-airline/vim-airline", "nvim-lualine/lualine.nvim",
"vim-airline/vim-airline-themes", "nvim-tree/nvim-web-devicons",
-- Auto commenting per filetype -- Auto commenting per filetype
"numToStr/Comment.nvim", "numToStr/Comment.nvim",
-- Give option to save files using sudo, if needed -- Give option to save files using sudo, if needed
"lambdalisue/suda.vim", "lambdalisue/suda.vim",
-- Auto toggle for number mode when vim isn't focused -- Auto toggle for number mode when vim isn't focused
"sitiom/nvim-numbertoggle", "sitiom/nvim-numbertoggle",
-- Plugin for lean
"nvim-tree/nvim-tree.lua",
"nvim-tree/nvim-web-devicons",
-- LSP related plugins -- LSP related plugins
"neovim/nvim-lspconfig", "neovim/nvim-lspconfig",
"nvim-lua/plenary.nvim", "nvim-lua/plenary.nvim",

View file

@ -1,45 +0,0 @@
" enable tabline
let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
let g:airline#extensions#tabline#right_sep = ''
let g:airline#extensions#tabline#right_alt_sep = ''
" air-line
let g:airline_powerline_fonts = 1
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
" unicode symbols
let g:airline_left_sep = '»'
let g:airline_left_sep = '▶'
let g:airline_right_sep = '«'
let g:airline_right_sep = '◀'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.linenr = '␤'
let g:airline_symbols.linenr = '¶'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
" airline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
" Switch to your current theme
let g:airline_theme = 'moonfly'
" Always show tabs
set showtabline=2
" We don't need to see things like -- INSERT -- anymore
set noshowmode

View file

@ -1,61 +0,0 @@
local cmp = require'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
completion = cmp.config.window.bordered(winhighlight),
documentation = cmp.config.window.bordered(winhighlight),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {{ name = 'buffer' }}
),
experimental = { ghost_text = true },
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})

13
vps/plugin/lualine.lua Normal file
View file

@ -0,0 +1,13 @@
require("lualine").setup{
options = {
theme = 'moonfly',
},
tabline = {
lualine_a = {'buffers'},
lualine_b = {},
lualine_c = {},
lualine_x = {},
lualine_y = {'filename'},
lualine_z = {'tabs'},
},
}

View file

@ -1,11 +0,0 @@
require'lspconfig'.pyright.setup({
on_attach = on_attach,
flags = lsp_flags,
settings = {
python = {
analysis = {
typeCheckingMode = "off"
}
}
}
})

5
vps/plugin/suda.lua Normal file
View file

@ -0,0 +1,5 @@
-- Disable Suda in diff views
if not vim.api.nvim_win_get_option(0, 'diff') then
vim.g.suda_smart_edit = 1
end

View file

@ -1,3 +0,0 @@
if ! &diff
let g:suda_smart_edit = 1
endif