Compare commits
27
Commits
f5fd3fab66
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
92a41d8aad | ||
|
|
88f16fd877 | ||
|
|
99a9603b87 | ||
|
|
5723c9d3c2 | ||
|
|
1df73b0a74 | ||
|
|
b58be03795 | ||
|
|
dd484dd4ae | ||
|
|
7bcd0d480b | ||
|
|
3de823f924 | ||
|
|
ec0c5d5a8a | ||
|
|
12e422b9c3 | ||
|
|
daab290325 | ||
|
|
b0d189b529 | ||
|
|
5e7e681b0e | ||
|
|
8f4735c4a3 | ||
|
|
c25dc94e80 | ||
|
|
50fb5321c2 | ||
|
|
4979cd2b87 | ||
|
|
5934fc3970 | ||
|
|
366fe1ec2b | ||
|
|
e15a2b85d4 | ||
|
|
ce2f3fc2fd | ||
|
|
0420953d3a | ||
|
|
df3ce8e0bc | ||
|
|
171ac607c7 | ||
|
|
b6a1b042a3 | ||
|
|
d031d24178 |
No files matched your search
@@ -3,7 +3,7 @@
|
|||||||
- Install packages:
|
- Install packages:
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo pacman -S neovim neovim-qt fzf xclip
|
sudo pacman -S fd fzf neovim neovim-qt xclip xxhash wl-clipboard
|
||||||
```
|
```
|
||||||
|
|
||||||
- `mkdir ~/.config/nvim`
|
- `mkdir ~/.config/nvim`
|
||||||
@@ -13,3 +13,5 @@ sudo pacman -S neovim neovim-qt fzf xclip
|
|||||||
```
|
```
|
||||||
vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim")
|
vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim")
|
||||||
```
|
```
|
||||||
|
|
||||||
|
- Configure Plasma application settings for nvim-qt to disable focus stealing prevention
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
au BufNewFile,BufRead *.propane set filetype=propane
|
||||||
+95
-1
@@ -5,23 +5,117 @@ vim.cmd([[colorscheme tokyonight-night]])
|
|||||||
-- Load fzf-lua plugin
|
-- Load fzf-lua plugin
|
||||||
vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim/fzf-lua.nvim")
|
vim.opt.rtp:prepend("~/.config/nvim/holtrop.nvim/fzf-lua.nvim")
|
||||||
vim.cmd([[runtime plugin/fzf-lua.lua]])
|
vim.cmd([[runtime plugin/fzf-lua.lua]])
|
||||||
|
require('fzf-lua').setup({
|
||||||
|
winopts = {
|
||||||
|
preview = {
|
||||||
|
layout = 'vertical',
|
||||||
|
vertical = 'down:50%',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
keymap = {
|
||||||
|
fzf = {
|
||||||
|
["tab"] = "down",
|
||||||
|
["shift-tab"] = "up",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
-- Show titlestring in GUI window title
|
-- Show titlestring in GUI window title
|
||||||
vim.opt.title = true
|
vim.opt.title = true
|
||||||
vim.opt.titlestring = "%t%m%r%{exists('g:project_name') ? ' : '.g:project_name : ''}"
|
vim.opt.titlestring = "%t%m%r%{exists('g:project_name') ? ' : '.g:project_name : ''}"
|
||||||
|
vim.opt.modeline = false
|
||||||
|
vim.opt.colorcolumn = "80"
|
||||||
|
vim.opt.cursorcolumn = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.so = 8
|
||||||
|
vim.opt.wildmode = {'list:longest'}
|
||||||
|
vim.opt.splitbelow = true
|
||||||
|
vim.opt.splitright = true
|
||||||
|
vim.g.editorconfig = false
|
||||||
|
-- Following are also set in the BufReadPost autocommand below
|
||||||
vim.opt.expandtab = true
|
vim.opt.expandtab = true
|
||||||
|
vim.opt.ts = 4
|
||||||
vim.opt.sw = 4
|
vim.opt.sw = 4
|
||||||
vim.opt.sts = 4
|
vim.opt.sts = 4
|
||||||
vim.opt.colorcolumn = "80,120"
|
vim.opt.cinoptions = ":0,g0"
|
||||||
|
|
||||||
|
local holtrop_bufread_group = vim.api.nvim_create_augroup("holtrop_bufread_group", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd({ "BufReadPost", "BufNewFile" }, {
|
||||||
|
group = holtrop_bufread_group,
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
vim.schedule(function()
|
||||||
|
if vim.bo.filetype ~= "make" then
|
||||||
|
vim.opt_local.expandtab = true
|
||||||
|
end
|
||||||
|
local ft = vim.bo.filetype
|
||||||
|
local indent = 4
|
||||||
|
if ft == "ruby" or ft == "html" or ft == "xml" then
|
||||||
|
indent = 2
|
||||||
|
end
|
||||||
|
vim.opt_local.ts = indent
|
||||||
|
vim.opt_local.sw = indent
|
||||||
|
vim.opt_local.sts = indent
|
||||||
|
vim.opt_local.cinoptions = ":0,g0"
|
||||||
|
end)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Restore cursor position after opening a file
|
||||||
|
local cursor_group = vim.api.nvim_create_augroup("holtrop_restore_cursor", { clear = true })
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd("BufReadPost", {
|
||||||
|
group = cursor_group,
|
||||||
|
pattern = "*",
|
||||||
|
callback = function()
|
||||||
|
-- Get the row and column of the last cursor position mark
|
||||||
|
local mark = vim.api.nvim_buf_get_mark(0, '"')
|
||||||
|
local lcount = vim.api.nvim_buf_line_count(0)
|
||||||
|
|
||||||
|
-- If the mark is valid, jump to it, unless it's a git commit message
|
||||||
|
if mark[1] > 0 and mark[1] <= lcount and vim.bo.filetype ~= "gitcommit" then
|
||||||
|
pcall(vim.api.nvim_win_set_cursor, 0, mark)
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
-- Shortcuts
|
-- Shortcuts
|
||||||
vim.cmd([[map <C-s> :FzfLua combine pickers=buffers,git_files<CR>]])
|
vim.cmd([[map <C-s> :FzfLua combine pickers=buffers,git_files<CR>]])
|
||||||
|
vim.cmd([[map f<C-s> :FzfLua combine pickers=buffers,files<CR>]])
|
||||||
|
vim.cmd([[inoremap <C-Enter> <Esc>O]])
|
||||||
vim.cmd([[vnoremap < <gv]])
|
vim.cmd([[vnoremap < <gv]])
|
||||||
vim.cmd([[vnoremap > >gv]])
|
vim.cmd([[vnoremap > >gv]])
|
||||||
vim.cmd([[nnoremap <silent> ,t :tabn<CR>]])
|
vim.cmd([[nnoremap <silent> ,t :tabn<CR>]])
|
||||||
vim.cmd([[nnoremap <silent> ,T :tabp<CR>]])
|
vim.cmd([[nnoremap <silent> ,T :tabp<CR>]])
|
||||||
vim.cmd([[nnoremap <silent> <C-S-PageUp> :tabmove -1<CR>]])
|
vim.cmd([[nnoremap <silent> <C-S-PageUp> :tabmove -1<CR>]])
|
||||||
vim.cmd([[nnoremap <silent> <C-S-PageDown> :tabmove +1<CR>]])
|
vim.cmd([[nnoremap <silent> <C-S-PageDown> :tabmove +1<CR>]])
|
||||||
|
vim.cmd([[nnoremap <silent> ,j Ji<CR><Esc>]])
|
||||||
|
vim.cmd([[nnoremap ,s :%s/\v +$//<CR>]])
|
||||||
|
|
||||||
-- Use system clipboard for unnamed register
|
-- Use system clipboard for unnamed register
|
||||||
vim.opt.clipboard = "unnamedplus"
|
vim.opt.clipboard = "unnamedplus"
|
||||||
|
|
||||||
|
-- Reload file automatically if changed externally
|
||||||
|
vim.o.autoread = true
|
||||||
|
vim.api.nvim_create_autocmd({ "FocusGained", "BufEnter" }, {
|
||||||
|
group = vim.api.nvim_create_augroup("AutoRead", { clear = true }),
|
||||||
|
callback = function()
|
||||||
|
if vim.fn.mode() ~= 'c' then
|
||||||
|
vim.cmd("checktime")
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
vim.filetype.add({filename = {["Rsconscript"] = "ruby"}})
|
||||||
|
|
||||||
|
-- Treat *.rs.erb files as eruby with an embedded Rust subtype
|
||||||
|
vim.filetype.add({
|
||||||
|
pattern = {
|
||||||
|
[".*%.rs%.erb"] = function(_, bufnr)
|
||||||
|
return "eruby", function()
|
||||||
|
vim.b[bufnr].eruby_subtype = "rust"
|
||||||
|
end
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
" Vim syntax file for Propane
|
||||||
|
" Language: propane
|
||||||
|
" Maintainer: Josh Holtrop
|
||||||
|
" URL: https://github.com/holtrop/propane
|
||||||
|
|
||||||
|
if exists("b:current_syntax")
|
||||||
|
finish
|
||||||
|
endif
|
||||||
|
|
||||||
|
if !exists("b:propane_subtype")
|
||||||
|
if search('\<import\s\+\%(std\|core\)\.', 'nw') > 0
|
||||||
|
let b:propane_subtype = "d"
|
||||||
|
else
|
||||||
|
let b:propane_subtype = "cpp"
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
exe "syn include @propaneTarget syntax/".b:propane_subtype.".vim"
|
||||||
|
|
||||||
|
syn region propaneTarget matchgroup=propaneDelimiter start="<<" end=">>$" contains=@propaneTarget keepend
|
||||||
|
|
||||||
|
syn match propaneComment "#.*"
|
||||||
|
syn match propaneFieldAlias ":[a-zA-Z0-9_]\+" contains=propaneFieldOperator
|
||||||
|
syn match propaneFieldOperator ":" contained
|
||||||
|
syn match propaneOperator "?"
|
||||||
|
" The right-hand side of a rule (after '->' up to '<<' or ';') lists symbol
|
||||||
|
" names that may coincide with propane keywords (e.g. 'start', 'token',
|
||||||
|
" 'tree'). Wrap it in a region that excludes keyword matches so those names
|
||||||
|
" are not highlighted as keywords. The '<<' is left unconsumed so the
|
||||||
|
" propaneTarget region can still match it.
|
||||||
|
syn region propaneRuleRhs matchgroup=propaneOperator start="->" end="\ze<<" end=";" contains=propaneFieldAlias,propaneRuleOperator,propaneComment keepend
|
||||||
|
syn match propaneRuleOperator "?" contained
|
||||||
|
" Keywords that introduce a user-defined name. The name is consumed by
|
||||||
|
" propaneName via nextgroup so a name matching a keyword (e.g. 'token start')
|
||||||
|
" is not highlighted as a keyword. These must be a match (not syn keyword)
|
||||||
|
" because a syn keyword always wins over a contained nextgroup match.
|
||||||
|
syn match propaneNameDecl "\<\%(tokenid\|token\|lex_fn\|module\|start\|tree_prefix\|tree_suffix\)\>" nextgroup=propaneName skipwhite
|
||||||
|
syn match propaneName "\<\h\w*\>" contained
|
||||||
|
syn match propaneKeyword "\<\%(context_user_fields\|drop\|free_token_node\|noline\|on_token_node\|prefix\|ptype\|token_user_fields\|tree\)\>"
|
||||||
|
|
||||||
|
syn region propaneRegex start="/" end="/" skip="\v\\\\|\\/"
|
||||||
|
|
||||||
|
hi def link propaneComment Comment
|
||||||
|
hi def link propaneKeyword Keyword
|
||||||
|
hi def link propaneNameDecl Keyword
|
||||||
|
hi def link propaneRegex String
|
||||||
|
hi def link propaneOperator Operator
|
||||||
|
hi def link propaneRuleOperator Operator
|
||||||
|
hi def link propaneFieldOperator Operator
|
||||||
|
hi def link propaneDelimiter Delimiter
|
||||||
|
hi def link propaneFieldAlias Identifier
|
||||||
Reference in new issue
Block a user