Compare commits
6 Commits
9f0d9890fd
...
helpgrep
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d21cd45701 | ||
|
|
9d5868304f | ||
| 56beb52997 | |||
| 48ad466bd3 | |||
| 4499dee3d6 | |||
| d75531ae3d |
@@ -1 +0,0 @@
|
|||||||
autocmd BufNewFile,BufReadPost CMakeCache.txt set filetype=cmakecache
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Force *.def to C++ filetype for LLVM
|
|
||||||
au BufNewFile,BufReadPost *.def set filetype=cpp
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Set .ll files to LLVM IR filetype
|
|
||||||
au BufNewFile,BufReadPost *.ll set filetype=llvm
|
|
||||||
au BufNewFile,BufReadPost *.test set filetype=llvm
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Force *.md to markdown filetype
|
|
||||||
au BufNewFile,BufReadPost *.md set filetype=markdown
|
|
||||||
au BufNewFile,BufReadPost *.ronn set filetype=markdown
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Force *.cl to OpenCL C filetype
|
|
||||||
au BufNewFile,BufReadPost *.cl set filetype=opencl
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Force lit.cfg/lit.local.cfg to be Python
|
|
||||||
au BufNewFile,BufReadPost lit.cfg set filetype=python
|
|
||||||
au BufNewFile,BufReadPost lit.local.cfg set filetype=python
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
autocmd BufNewFile,BufReadPost */requirements.txt set filetype=requirements
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
" Force *.td to tablegen filetype
|
|
||||||
au BufNewFile,BufReadPost *.td set filetype=tablegen
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
" Force .enter/.exit to be zsh
|
|
||||||
au BufNewFile,BufReadPost .enter set filetype=zsh
|
|
||||||
au BufNewFile,BufReadPost .exit set filetype=zsh
|
|
||||||
2
init.lua
2
init.lua
@@ -1,8 +1,6 @@
|
|||||||
vim.g.mapleader = ' '
|
vim.g.mapleader = ' '
|
||||||
vim.g.maplocalleader = ' '
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
require('statusline')
|
|
||||||
|
|
||||||
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim'
|
||||||
if not vim.loop.fs_stat(lazypath) then
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
vim.fn.system({ 'git', 'clone', '--filter=blob:none',
|
vim.fn.system({ 'git', 'clone', '--filter=blob:none',
|
||||||
|
|||||||
@@ -93,11 +93,7 @@ return {
|
|||||||
['clangd'] = function()
|
['clangd'] = function()
|
||||||
require('lspconfig').clangd.setup({
|
require('lspconfig').clangd.setup({
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
cmd = {
|
cmd = { 'clangd', '--completion-style=detailed' }
|
||||||
'clangd',
|
|
||||||
'--completion-style=detailed',
|
|
||||||
'--function-arg-placeholders=1',
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|||||||
@@ -5,9 +5,11 @@ return {
|
|||||||
'nvim-telescope/telescope-fzy-native.nvim',
|
'nvim-telescope/telescope-fzy-native.nvim',
|
||||||
'nvim-tree/nvim-web-devicons',
|
'nvim-tree/nvim-web-devicons',
|
||||||
'axkirillov/easypick.nvim',
|
'axkirillov/easypick.nvim',
|
||||||
|
'catgoose/telescope-helpgrep.nvim',
|
||||||
},
|
},
|
||||||
config = function()
|
config = function()
|
||||||
local telescope = require('telescope')
|
local telescope = require('telescope')
|
||||||
|
local actions = require('telescope.actions')
|
||||||
telescope.setup({
|
telescope.setup({
|
||||||
defaults = {
|
defaults = {
|
||||||
mappings = {
|
mappings = {
|
||||||
@@ -20,11 +22,25 @@ return {
|
|||||||
['<C-s>'] = 'select_horizontal',
|
['<C-s>'] = 'select_horizontal',
|
||||||
['<C-h>'] = 'preview_scrolling_left',
|
['<C-h>'] = 'preview_scrolling_left',
|
||||||
['<C-l>'] = 'preview_scrolling_right',
|
['<C-l>'] = 'preview_scrolling_right',
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
layout_config = {
|
layout_config = {
|
||||||
height = 0.7,
|
height = 0.7,
|
||||||
}
|
},
|
||||||
|
},
|
||||||
|
extensions = {
|
||||||
|
helpgrep = {
|
||||||
|
mappings = {
|
||||||
|
i = {
|
||||||
|
["<CR>"] = actions.select_default,
|
||||||
|
["<C-v>"] = actions.select_vertical,
|
||||||
|
},
|
||||||
|
n = {
|
||||||
|
["<CR>"] = actions.select_default,
|
||||||
|
["<C-s>"] = actions.select_horizontal,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
telescope.load_extension('fzy_native')
|
telescope.load_extension('fzy_native')
|
||||||
@@ -36,7 +52,8 @@ return {
|
|||||||
vim.keymap.set('n', '<leader>gg', builtin.live_grep, opts)
|
vim.keymap.set('n', '<leader>gg', builtin.live_grep, opts)
|
||||||
vim.keymap.set('n', '<leader>rg', builtin.grep_string, opts)
|
vim.keymap.set('n', '<leader>rg', builtin.grep_string, opts)
|
||||||
vim.keymap.set('n', '<leader>gb', builtin.buffers, opts)
|
vim.keymap.set('n', '<leader>gb', builtin.buffers, opts)
|
||||||
vim.keymap.set('n', '<leader>gh', builtin.help_tags, opts)
|
vim.keymap.set('n', '<leader>ht', builtin.help_tags, opts)
|
||||||
|
vim.keymap.set('n', '<leader>gh', require('telescope-helpgrep').live_grep, opts)
|
||||||
vim.keymap.set('n', '<leader>bl', builtin.current_buffer_fuzzy_find, opts)
|
vim.keymap.set('n', '<leader>bl', builtin.current_buffer_fuzzy_find, opts)
|
||||||
|
|
||||||
require('easypick').setup({
|
require('easypick').setup({
|
||||||
|
|||||||
19
plugin/filetype.lua
Normal file
19
plugin/filetype.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
vim.filetype.add({
|
||||||
|
extension = {
|
||||||
|
cl = 'opencl',
|
||||||
|
def = 'cpp',
|
||||||
|
ll = 'llvm',
|
||||||
|
md = 'markdown',
|
||||||
|
ronn = 'markdown',
|
||||||
|
td = 'tablegen',
|
||||||
|
test = 'llvm',
|
||||||
|
},
|
||||||
|
filename = {
|
||||||
|
['.enter'] = 'zsh',
|
||||||
|
['.exit'] = 'zsh',
|
||||||
|
['CMakeCache.txt'] = 'cmakecache',
|
||||||
|
['lit.cfg'] = 'python',
|
||||||
|
['lit.local.cfg'] = 'python',
|
||||||
|
['requirements.txt'] = 'requirements',
|
||||||
|
},
|
||||||
|
})
|
||||||
@@ -109,7 +109,7 @@ end
|
|||||||
|
|
||||||
-- Define active statusline, this statusline is dynamic with StatusLineLight
|
-- Define active statusline, this statusline is dynamic with StatusLineLight
|
||||||
-- being updated based on the current mode and only used for current buffer.
|
-- being updated based on the current mode and only used for current buffer.
|
||||||
function statusline.active()
|
function _G.statusline_active()
|
||||||
local mode = get_mode()
|
local mode = get_mode()
|
||||||
if vim.o.buftype == 'help' then
|
if vim.o.buftype == 'help' then
|
||||||
if mode == 'Normal' then mode = 'Help' end
|
if mode == 'Normal' then mode = 'Help' end
|
||||||
@@ -138,7 +138,7 @@ function statusline.active()
|
|||||||
return generic('StatusLineLight', mode, true)
|
return generic('StatusLineLight', mode, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
function statusline.inactive()
|
function _G.statusline_inactive()
|
||||||
local mode = modes[vim.fn.char2nr(vim.fn.mode())].name
|
local mode = modes[vim.fn.char2nr(vim.fn.mode())].name
|
||||||
local line = ''
|
local line = ''
|
||||||
if vim.o.buftype == 'help' then
|
if vim.o.buftype == 'help' then
|
||||||
@@ -169,7 +169,7 @@ vim.api.nvim_create_autocmd({ 'BufEnter', 'WinEnter', 'BufWinEnter' }, {
|
|||||||
pattern = '*',
|
pattern = '*',
|
||||||
group = group,
|
group = group,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd.setlocal("statusline=%{%v:lua.require('statusline').active()%}")
|
vim.cmd.setlocal("statusline=%{%v:lua.statusline_active()%}")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ vim.api.nvim_create_autocmd({ 'BufLeave', 'WinLeave' }, {
|
|||||||
pattern = '*',
|
pattern = '*',
|
||||||
group = group,
|
group = group,
|
||||||
callback = function()
|
callback = function()
|
||||||
vim.cmd.setlocal("statusline=%{%v:lua.require('statusline').inactive()%}")
|
vim.cmd.setlocal("statusline=%{%v:lua.statusline_inactive()%}")
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
6
snippets/rst.snippets
Normal file
6
snippets/rst.snippets
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# reStructuredText snippets
|
||||||
|
|
||||||
|
snippet code
|
||||||
|
.. code-block:: ${1:language}
|
||||||
|
|
||||||
|
$0
|
||||||
Reference in New Issue
Block a user