1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-10-10 19:41:15 +02:00

nvim: swapped explorer and tagger for new lua plugins

This commit is contained in:
2023-07-29 05:52:55 +02:00
parent edd82ee7d9
commit a065c3d401
10 changed files with 286 additions and 230 deletions

View File

@@ -2,7 +2,7 @@
-- read files correctly
vim.filetype.add({
extension = {
extension = {
c = 'c',
h = 'c',
html = 'html',
@@ -13,96 +13,112 @@ extension = {
nim = 'nim',
py = 'python',
tex = 'tex',
}})
}
})
-- delete trailing whitespaces on save
vim.api.nvim_create_autocmd({'BufWritePre'},
{pattern = {'*'},
command = [[%s/\s\+$//e]],
})
vim.api.nvim_create_autocmd({ 'BufWritePre' },
{
pattern = { '*' },
command = [[%s/\s\+$//e]],
})
-- settings for filetype: c
vim.api.nvim_create_autocmd({'VimLeave'},
{pattern = {'c'},
command = '!cclear'
})
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
pattern = { 'c' },
command = '!cclear'
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'c'},
command = 'set colorcolumn=80'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'c' },
command = 'set colorcolumn=80'
})
-- settings for filetype: java
vim.api.nvim_create_autocmd({'FileType'},
{pattern = {'java'},
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'java' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'java'},
command = 'set colorcolumn=100'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'java' },
command = 'set colorcolumn=100'
})
-- settings for filetype: javascript
vim.api.nvim_create_autocmd({'FileType'},
{pattern = {'javascript'},
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'javascript' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
-- settings for filetype: lua
vim.api.nvim_create_autocmd({'FileType'},
{pattern = {'lua'},
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'lua' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'lua'},
command = 'set colorcolumn=100'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'lua' },
command = 'set colorcolumn=100'
})
-- settings for filetype: markdown
vim.api.nvim_create_autocmd({'FileType'},
{pattern = {'markdown'},
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({ 'FileType' },
{
pattern = { 'markdown' },
command = 'setlocal shiftwidth=2 softtabstop=2',
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'markdown'},
command = 'set colorcolumn=100'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'markdown' },
command = 'set colorcolumn=100'
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'markdown'},
command = 'set conceallevel=2'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'markdown' },
command = 'set conceallevel=2'
})
-- settings for filetype: nim
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'nim'},
command = 'set colorcolumn=80'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'nim' },
command = 'set colorcolumn=80'
})
-- settings for filetype: python
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'python'},
command = 'set colorcolumn=80'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'python' },
command = 'set colorcolumn=80'
})
-- settings for filetype: tex
vim.api.nvim_create_autocmd({'VimLeave'},
{pattern = {'tex'},
command = '!texclear %'
})
vim.api.nvim_create_autocmd({ 'VimLeave' },
{
pattern = { 'tex' },
command = '!texclear %'
})
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
{pattern = {'tex'},
command = 'set colorcolumn=80'
})
vim.api.nvim_create_autocmd({ 'BufEnter', 'FileType' },
{
pattern = { 'tex' },
command = 'set colorcolumn=80'
})

View File

@@ -3,4 +3,4 @@
-- basic color settings
vim.o.background = 'dark'
vim.cmd('colorscheme tccs')
vim.api.nvim_set_hl(0, 'colorcolumn', {bg='#772222'})
vim.api.nvim_set_hl(0, 'colorcolumn', { bg = '#772222' })

View File

@@ -4,56 +4,56 @@
vim.g.mapleader = ","
-- shortcut for split navigation
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', {noremap = true})
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', {noremap = true})
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', {noremap = true})
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', {noremap = true})
vim.api.nvim_set_keymap('n', '<C-h>', '<C-w>h', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-j>', '<C-w>j', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-k>', '<C-w>k', { noremap = true })
vim.api.nvim_set_keymap('n', '<C-l>', '<C-w>l', { noremap = true })
-- unmap unwanted commands
vim.api.nvim_set_keymap('n', '<F1>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F4>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F9>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F10>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F11>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F12>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F2>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F3>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F4>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F5>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F6>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F7>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F8>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F9>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F10>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F11>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('i', '<F12>', '<NOP>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F1>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F4>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F9>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F10>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F11>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F12>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F2>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F3>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F4>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F5>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F6>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F7>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F8>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F9>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F10>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F11>', '<NOP>', { noremap = true })
vim.api.nvim_set_keymap('i', '<F12>', '<NOP>', { noremap = true })
-- mapping Dictionaries
vim.api.nvim_set_keymap('n', '<F6>', ':setlocal spell! spelllang=de_de<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F7>', ':setlocal spell! spelllang=en_us<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<F6>', ':setlocal spell! spelllang=de_de<CR>', { noremap = true })
vim.api.nvim_set_keymap('n', '<F7>', ':setlocal spell! spelllang=en_us<CR>', { noremap = true })
-- compiler for languages
vim.api.nvim_set_keymap('n', '<leader>c', ':w! | !compiler <c-r>%<CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>c', ':w! | !compiler <c-r>%<CR>', { noremap = true })
-- open corresponding file (pdf/html/...)
vim.api.nvim_set_keymap('n', '<leader>p', ':!opout <c-r>%<CR><CR>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>p', ':!opout <c-r>%<CR><CR>', { noremap = true })
-- save file as sudo on files that require root permission
vim.api.nvim_set_keymap('c', 'w!!', '"silent! write !sudo tee % >/dev/null" <bar> edit!', {noremap = true})
vim.api.nvim_set_keymap('c', 'w!!', '"silent! write !sudo tee % >/dev/null" <bar> edit!', { noremap = true })
-- alias for replacing
vim.api.nvim_set_keymap('n', '<leader>ss', ':%s//gI<Left><Left><Left>', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>ss', ':%s//gI<Left><Left><Left>', { noremap = true })
-- irc compatibility for interactivity
vim.api.nvim_set_keymap('n', '<leader>is', ':.w >> in<cr>dd', {noremap = true})
vim.api.nvim_set_keymap('n', '<leader>is', ':.w >> in<cr>dd', { noremap = true })
-- majutsushi/tagbar
vim.api.nvim_set_keymap('n', '<F3>', ':TagbarToggle<CR>', {})
vim.api.nvim_set_keymap('n', '<F3>', ':Navbuddy<CR>', {})
-- scrooloose/nerdtree
vim.api.nvim_set_keymap('n', '<F2>', ':NERDTreeToggle<CR>', {})
vim.api.nvim_set_keymap('n', '<F2>', ':Neotree toggle<CR>', {})
-- tpope/vim-fugitive
vim.api.nvim_set_keymap('n', '<leader>ga', ':Git add %:p<CR><CR>', { noremap = true })

View File

@@ -3,9 +3,9 @@
-- bootstrap packer
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
vim.cmd [[packadd packer.nvim]]
return true
end
@@ -16,98 +16,113 @@ local packer_bootstrap = ensure_packer()
-- load plugins with packer
return require("packer").startup(function(use)
-- package manager (first entry)
use {'wbthomason/packer.nvim'}
-- package manager (first entry)
use { 'wbthomason/packer.nvim' }
-- improved java syntax highlighting
use {'uiiaoo/java-syntax.vim',
ft = {'java'}}
-- improved java syntax highlighting
use { 'uiiaoo/java-syntax.vim',
ft = { 'java' } }
-- custom statusline
use {'itchyny/lightline.vim',
require = {"tiyn/vim-tccs"}}
-- custom statusline
use { 'itchyny/lightline.vim',
require = { "tiyn/vim-tccs" } }
-- latex asynchronous pdf rendering
use {'donRaphaco/neotex',
ft = {'tex'}}
-- show signature while typing
use { 'ray-x/lsp_signature.nvim' }
-- navigating folders with a file tree
use {'scrooloose/nerdtree',
cmd = 'NERDTreeToggle',
requires = 'ryanoasis/vim-devicons'}
-- latex asynchronous pdf rendering
use { 'donRaphaco/neotex',
ft = { 'tex' } }
-- nim language support
use {'zah/nim.vim',
ft = {'nim'}}
-- fileexplorer on the side
use {
"nvim-neo-tree/neo-tree.nvim",
branch = "v3.x",
requires = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
"MunifTanjim/nui.nvim",
}
}
-- automatic closing of brackets
use {'windwp/nvim-autopairs'}
-- nim language support
use { 'zah/nim.vim',
ft = { 'nim' } }
-- autocompletion and its sources
use {'hrsh7th/nvim-cmp',
requires = {'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lsp',
'antoinemadec/fixcursorhold.nvim',
'l3mon4d3/luasnip',
'saadparwaiz1/cmp_luasnip',
'neovim/nvim-lspconfig',
'onsails/lspkind-nvim',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'jose-elias-alvarez/null-ls.nvim',
'LostNeophyte/null-ls-embedded',
'nvim-lua/plenary.nvim',
'jay-babu/mason-null-ls.nvim'}}
-- automatic closing of brackets
use { 'windwp/nvim-autopairs' }
-- showing color of hex values, etc
use {'norcalli/nvim-colorizer.lua'}
-- autocompletion and its sources
use { 'hrsh7th/nvim-cmp',
requires = { 'hrsh7th/cmp-buffer',
'hrsh7th/cmp-path',
'hrsh7th/cmp-nvim-lsp',
'lukas-reineke/cmp-under-comparator',
'antoinemadec/fixcursorhold.nvim',
'l3mon4d3/luasnip',
'saadparwaiz1/cmp_luasnip',
'neovim/nvim-lspconfig',
'onsails/lspkind-nvim',
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'jose-elias-alvarez/null-ls.nvim',
'LostNeophyte/null-ls-embedded',
'nvim-lua/plenary.nvim',
'jay-babu/mason-null-ls.nvim' } }
-- better language highlighting by improved parsing
use {'nvim-treesitter/nvim-treesitter'}
-- showing color of hex values, etc
use { 'norcalli/nvim-colorizer.lua' }
-- automatically close html-tags
use {'windwp/nvim-ts-autotag',
requires = {'nvim-treesitter/nvim-treesitter'}}
-- show tags
use {
"SmiteshP/nvim-navbuddy",
requires = {
"neovim/nvim-lspconfig",
"SmiteshP/nvim-navic",
"MunifTanjim/nui.nvim",
}
}
-- colorful brackets
use {'luochen1990/rainbow'}
-- better language highlighting by improved parsing
use { 'nvim-treesitter/nvim-treesitter' }
-- show tags
use {'majutsushi/tagbar',
cmd = 'TagbarToggle'}
-- automatically close html-tags
use { 'windwp/nvim-ts-autotag',
requires = { 'nvim-treesitter/nvim-treesitter' } }
-- todo symbols and highlighting
use {'folke/todo-comments.nvim',
requires = {'nvim-lua/plenary.nvim'}}
-- colorful brackets
use { 'luochen1990/rainbow' }
-- git wrapper
use {'tpope/vim-fugitive'}
-- todo symbols and highlighting
use { 'folke/todo-comments.nvim',
requires = { 'nvim-lua/plenary.nvim' } }
-- indicate git diff status of line
use {'airblade/vim-gitgutter'}
-- git wrapper
use { 'tpope/vim-fugitive' }
-- golang language support
use {'fatih/vim-go',
ft = {'go'}}
-- indicate git diff status of line
use { 'airblade/vim-gitgutter' }
-- markdown language support
use {'preservim/vim-markdown',
ft = {'md'},
requires = {'godlygeek/tabular'}}
-- golang language support
use { 'fatih/vim-go',
ft = { 'go' } }
-- bulk renamer
use {'qpkorr/vim-renamer'}
-- markdown language support
use { 'preservim/vim-markdown',
ft = { 'md' },
requires = { 'godlygeek/tabular' } }
-- additional quote/parantheses funtions
use {'tpope/vim-surround'}
-- bulk renamer
use { 'qpkorr/vim-renamer' }
-- colorscheme
use {'tiyn/vim-tccs'}
-- additional quote/parantheses funtions
use { 'tpope/vim-surround' }
-- package manager sync (last entry)
if packer_bootstrap then
require('packer').sync()
end
-- colorscheme
use { 'tiyn/vim-tccs' }
-- package manager sync (last entry)
if packer_bootstrap then
require('packer').sync()
end
end)