mirror of
https://github.com/tiyn/dotfiles.git
synced 2025-04-19 16:27:45 +02:00
Compare commits
No commits in common. "933819855f8f2783353f643be99b08c2d6c48a0c" and "b37c4d1c61ecd0d607ce5861adfeeb35e2af9925" have entirely different histories.
933819855f
...
b37c4d1c61
@ -56,11 +56,14 @@ vim.g.python_host_prog = '/usr/bin/python2'
|
||||
vim.g.python3_host_prog = '/usr/bin/python3'
|
||||
|
||||
-- set filetypes correctly by extension
|
||||
require('autocmd')
|
||||
require('filetype')
|
||||
|
||||
-- load plugins (autoload all files in plugin folder)
|
||||
require('loadplugins')
|
||||
|
||||
-- load filetype specific mappings and commands
|
||||
require('autocmd')
|
||||
|
||||
-- load general mapped keys
|
||||
require('keymap')
|
||||
|
||||
|
@ -1,17 +1,4 @@
|
||||
-- read files correctly
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
c = 'c',
|
||||
h = 'c',
|
||||
html = 'html',
|
||||
java = 'java',
|
||||
js = 'javascript',
|
||||
lua = 'lua',
|
||||
md = 'markdown',
|
||||
nim = 'nim',
|
||||
py = 'python',
|
||||
tex = 'tex',
|
||||
}})
|
||||
-- autocmd
|
||||
|
||||
-- delete trailing whitespaces on save
|
||||
vim.api.nvim_create_autocmd({'BufWritePre'},
|
||||
@ -19,88 +6,67 @@ vim.api.nvim_create_autocmd({'BufWritePre'},
|
||||
command = [[%s/\s\+$//e]],
|
||||
})
|
||||
|
||||
-- c
|
||||
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'c'},
|
||||
command = '!cclear'
|
||||
-- formatting options
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- java
|
||||
|
||||
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'
|
||||
})
|
||||
|
||||
-- javascript
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'javascript'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
})
|
||||
|
||||
-- lua
|
||||
|
||||
vim.api.nvim_create_autocmd({'FileType'},
|
||||
{pattern = {'lua'},
|
||||
command = 'setlocal shiftwidth=2 softtabstop=2',
|
||||
-- cleanup certain files after leaving the editor
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'c'},
|
||||
command = '!cclear'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'lua'},
|
||||
command = 'set colorcolumn=100'
|
||||
})
|
||||
|
||||
-- markdown
|
||||
|
||||
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 conceallevel=2'
|
||||
})
|
||||
|
||||
-- nim
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- python
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- tex
|
||||
|
||||
vim.api.nvim_create_autocmd({'VimLeave'},
|
||||
{pattern = {'tex'},
|
||||
command = '!texclear %'
|
||||
})
|
||||
|
||||
-- highlighting break line
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'c'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'java'},
|
||||
command = 'set colorcolumn=100'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'nim'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'python'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'tex'},
|
||||
command = 'set colorcolumn=80'
|
||||
})
|
||||
|
||||
-- conceallevel
|
||||
vim.api.nvim_create_autocmd({'BufEnter', 'FileType'},
|
||||
{pattern = {'markdown'},
|
||||
command = 'set conceallevel=2'
|
||||
})
|
||||
|
||||
|
12
.config/nvim/lua/filetype.lua
Normal file
12
.config/nvim/lua/filetype.lua
Normal file
@ -0,0 +1,12 @@
|
||||
-- read files correctly
|
||||
vim.filetype.add({
|
||||
extension = {
|
||||
h = 'c',
|
||||
html = 'html',
|
||||
java = 'java',
|
||||
js = 'javascript',
|
||||
md = 'markdown',
|
||||
nim = 'nim',
|
||||
py = 'python',
|
||||
tex = 'tex',
|
||||
}})
|
@ -76,10 +76,6 @@ return require("packer").startup(function(use)
|
||||
use {'majutsushi/tagbar',
|
||||
cmd = 'TagbarToggle'}
|
||||
|
||||
-- todo symbols and highlighting
|
||||
use {'folke/todo-comments.nvim',
|
||||
requires = {'nvim-lua/plenary.nvim'}}
|
||||
|
||||
-- git wrapper
|
||||
use {'tpope/vim-fugitive'}
|
||||
|
||||
|
@ -1,61 +0,0 @@
|
||||
-- folke/todo-comments.nvim
|
||||
|
||||
require 'todo-comments'.setup {
|
||||
signs = true, -- show icons in the signs column
|
||||
sign_priority = 8, -- sign priority
|
||||
-- keywords recognized as todo comments
|
||||
keywords = {
|
||||
ERRO = { icon = " ", color = "error"},
|
||||
TODO = { icon = " ", color = "info" },
|
||||
HACK = { icon = " ", color = "warning"},
|
||||
WARN = { icon = " ", color = "warning"},
|
||||
PERF = { icon = " ", color = "default"},
|
||||
NOTE = { icon = " ", color = "hint"},
|
||||
TEST = { icon = " ", color = "test"},
|
||||
},
|
||||
gui_style = {
|
||||
fg = "NONE", -- The gui style to use for the fg highlight group.
|
||||
bg = "BOLD", -- The gui style to use for the bg highlight group.
|
||||
},
|
||||
merge_keywords = true, -- when true, custom keywords will be merged with the defaults
|
||||
-- highlighting of the line containing the todo comment
|
||||
-- * before: highlights before the keyword (typically comment characters)
|
||||
-- * keyword: highlights of the keyword
|
||||
-- * after: highlights after the keyword (todo text)
|
||||
highlight = {
|
||||
multiline = true, -- enable multine todo comments
|
||||
multiline_pattern = "^.", -- lua pattern to match the next multiline from the start of the matched keyword
|
||||
multiline_context = 10, -- extra lines that will be re-evaluated when changing a line
|
||||
before = "", -- "fg" or "bg" or empty
|
||||
keyword = "wide", -- "fg", "bg", "wide", "wide_bg", "wide_fg" or empty. (wide and wide_bg is the same as bg, but will also highlight surrounding characters, wide_fg acts accordingly but with fg)
|
||||
after = "fg", -- "fg" or "bg" or empty
|
||||
pattern = [[.*<(KEYWORDS)\s*:]], -- pattern or table of patterns, used for highlighting (vim regex)
|
||||
comments_only = true, -- uses treesitter to match keywords in comments only
|
||||
max_line_len = 400, -- ignore lines longer than this
|
||||
exclude = {}, -- list of file types to exclude highlighting
|
||||
},
|
||||
-- list of named colors where we try to extract the guifg from the
|
||||
-- list of highlight groups or use the hex color if hl not found as a fallback
|
||||
colors = {
|
||||
error = { "DiagnosticError", "ErrorMsg", "#DC2626" },
|
||||
warning = { "WarningMsg", "DiagnosticWarn", "#FBBF24" },
|
||||
info = { "Constant", "#2563EB" },
|
||||
hint = { "Comment", "#10B981" },
|
||||
default = { "Operator", "#7C3AED" },
|
||||
test = { "Function", "#FF00FF" }
|
||||
},
|
||||
search = {
|
||||
command = "rg",
|
||||
args = {
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
},
|
||||
-- regex that will be used to match keywords.
|
||||
-- don't replace the (KEYWORDS) placeholder
|
||||
pattern = [[\b(KEYWORDS):]], -- ripgrep regex
|
||||
-- pattern = [[\b(KEYWORDS)\b]], -- match without the extra colon. You'll likely get false positives
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user