Moved over to neovim completely, lua and all
This commit is contained in:
parent
2b2afb430e
commit
bbadef2b17
16 changed files with 189 additions and 247 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -5,3 +5,4 @@ doc
|
||||||
plugin
|
plugin
|
||||||
bundle
|
bundle
|
||||||
!bundle/Vundle.vim
|
!bundle/Vundle.vim
|
||||||
|
lazy-lock.json
|
||||||
|
|
|
||||||
3
.gitmodules
vendored
3
.gitmodules
vendored
|
|
@ -1,3 +0,0 @@
|
||||||
[submodule "bundle/Vundle.vim"]
|
|
||||||
path = bundle/Vundle.vim
|
|
||||||
url = https://github.com/VundleVim/Vundle.vim.git
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
Subproject commit b255382d6242d7ea3877bf059d2934125e0c4d95
|
|
||||||
3
init.lua
Normal file
3
init.lua
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
require("core.keymaps")
|
||||||
|
require("core.plugins")
|
||||||
|
require("core.plugin_config")
|
||||||
110
init.vim
110
init.vim
|
|
@ -1,110 +0,0 @@
|
||||||
" An example for a vimrc file.
|
|
||||||
"
|
|
||||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
|
||||||
" Last change: 2019 Jan 26
|
|
||||||
"
|
|
||||||
" To use it, copy it to
|
|
||||||
" for Unix and OS/2: ~/.vimrc
|
|
||||||
" for Amiga: s:.vimrc
|
|
||||||
" for MS-DOS and Win32: $VIM\_vimrc
|
|
||||||
" for OpenVMS: sys$login:.vimrc
|
|
||||||
|
|
||||||
" When started as "evim", evim.vim will already have done these settings, bail
|
|
||||||
" out.
|
|
||||||
if v:progname =~? "evim"
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Get the defaults that most users want.
|
|
||||||
if !has('nvim')
|
|
||||||
source $VIMRUNTIME/defaults.vim
|
|
||||||
endif
|
|
||||||
|
|
||||||
if has("vms")
|
|
||||||
set nobackup " do not keep a backup file, use versions instead
|
|
||||||
else
|
|
||||||
set backup " keep a backup file (restore to previous version)
|
|
||||||
if has('persistent_undo')
|
|
||||||
set undofile " keep an undo file (undo changes after closing)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
if &t_Co > 2 || has("gui_running")
|
|
||||||
" Switch on highlighting the last used search pattern.
|
|
||||||
set hlsearch
|
|
||||||
endif
|
|
||||||
|
|
||||||
" Put these in an autocmd group, so that we can delete them easily.
|
|
||||||
augroup vimrcEx
|
|
||||||
au!
|
|
||||||
|
|
||||||
" For all text files set 'textwidth' to 78 characters.
|
|
||||||
"autocmd FileType text setlocal textwidth=78
|
|
||||||
autocmd FileType mail,asciidoc,vimwiki,tex,text setlocal textwidth=80
|
|
||||||
autocmd FileType mail,asciidoc,vimwiki,tex,text setlocal linebreak
|
|
||||||
autocmd FileType mail,asciidoc,vimwiki,tex,text setlocal spell spelllang=en_gb
|
|
||||||
|
|
||||||
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" Add optional packages.
|
|
||||||
"
|
|
||||||
" The matchit plugin makes the % command work better, but it is not backwards
|
|
||||||
" compatible.
|
|
||||||
" The ! means the package won't be loaded right away but when plugins are
|
|
||||||
" loaded during initialization.
|
|
||||||
if has('syntax') && has('eval')
|
|
||||||
packadd! matchit
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
" :W sudo saves the file when the file is open in readonly mode
|
|
||||||
command W w !sudo tee % > /dev/null
|
|
||||||
|
|
||||||
set number
|
|
||||||
set expandtab
|
|
||||||
" 1 tab = 2 spaces
|
|
||||||
set tabstop=4 shiftwidth=4
|
|
||||||
set smarttab
|
|
||||||
set autoindent
|
|
||||||
" Ignore case when searching
|
|
||||||
set ignorecase
|
|
||||||
set smartcase
|
|
||||||
" highlight search results (after pressing Enter)
|
|
||||||
set hlsearch
|
|
||||||
" highlight all pattern matches WHILE typing the pattern
|
|
||||||
set incsearch
|
|
||||||
" show the mathing brackets
|
|
||||||
set showmatch
|
|
||||||
" Create backup directory if it doesn't exist
|
|
||||||
silent !mkdir ~/.cache/vim > /dev/null 2>&1
|
|
||||||
" tell vim where to put its backup files
|
|
||||||
set backupdir=~/.cache/vim
|
|
||||||
set undodir=~/.cache/vim
|
|
||||||
set dir=~/.cache/vim
|
|
||||||
|
|
||||||
" set colors
|
|
||||||
if has("termguicolors")
|
|
||||||
set termguicolors
|
|
||||||
endif
|
|
||||||
colorscheme desert
|
|
||||||
hi Normal guibg=NONE ctermbg=NONE
|
|
||||||
hi EndOfBuffer guibg=NONE ctermbg=NONE
|
|
||||||
" highlight current line
|
|
||||||
set cursorline
|
|
||||||
hi clear CursorLine
|
|
||||||
hi CursorLine ctermbg=8 guibg=#404040
|
|
||||||
hi Cursor ctermbg=15
|
|
||||||
" set spellcheck
|
|
||||||
"set spell
|
|
||||||
|
|
||||||
" Make reading easier
|
|
||||||
set wrap linebreak nolist
|
|
||||||
set concealcursor=""
|
|
||||||
|
|
||||||
"Leader mapping
|
|
||||||
let mapleader = "\<Space>"
|
|
||||||
nnoremap <Leader>? :echon " n :Lex \n l? lsp help (if implemented in buffer)\n w? vimWiki help"<CR>
|
|
||||||
nnoremap <Leader>n :Sexplore<CR>
|
|
||||||
" Load Plugins
|
|
||||||
so plugins.vim
|
|
||||||
16
lua/core/keymaps.lua
Normal file
16
lua/core/keymaps.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
-- set leaders to space
|
||||||
|
vim.g.mapleader = ' '
|
||||||
|
vim.g.maplocalleader = ' '
|
||||||
|
|
||||||
|
vim.opt.backspace = '2'
|
||||||
|
vim.opt.showcmd = true
|
||||||
|
vim.opt.laststatus = 2
|
||||||
|
vim.opt.autowrite = true
|
||||||
|
vim.opt.cursorline = true
|
||||||
|
vim.opt.autoread = true
|
||||||
|
|
||||||
|
-- use spaces for tabs etc
|
||||||
|
vim.opt.tabstop = 2 -- Seems to be default for most lsp's now
|
||||||
|
vim.opt.shiftwidth = 2
|
||||||
|
vim.opt.shiftround = true
|
||||||
|
vim.opt.expandtab = true
|
||||||
18
lua/core/plugin_config/completions.lua
Normal file
18
lua/core/plugin_config/completions.lua
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
local cmp = require("cmp")
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||||
|
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||||
|
['<C-o>'] = cmp.mapping.complete(),
|
||||||
|
['<C-e>'] = cmp.mapping.abort(),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
snippet = {
|
||||||
|
},
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer' },
|
||||||
|
}),
|
||||||
|
})
|
||||||
2
lua/core/plugin_config/gruvbox.lua
Normal file
2
lua/core/plugin_config/gruvbox.lua
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
vim.o.termguicolors = true
|
||||||
|
vim.cmd [[colorscheme gruvbox]]
|
||||||
7
lua/core/plugin_config/init.lua
Normal file
7
lua/core/plugin_config/init.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
require("core.plugin_config.gruvbox")
|
||||||
|
require("core.plugin_config.lualine")
|
||||||
|
require("core.plugin_config.nvim-tree")
|
||||||
|
require("core.plugin_config.telescope")
|
||||||
|
require("core.plugin_config.treesitter")
|
||||||
|
require("core.plugin_config.lsp_config")
|
||||||
|
require("core.plugin_config.completions")
|
||||||
67
lua/core/plugin_config/lsp_config.lua
Normal file
67
lua/core/plugin_config/lsp_config.lua
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
require("mason").setup()
|
||||||
|
require("mason-lspconfig").setup({
|
||||||
|
ensure_installed = {"lua_ls", "clangd", "cmake", "ltex"}
|
||||||
|
})
|
||||||
|
-- gloabal mappings
|
||||||
|
vim.keymap.set('n', '<leader>le', vim.diagnostic.open_float)
|
||||||
|
--vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
|
||||||
|
--vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
|
||||||
|
vim.keymap.set('n', '<leader>lj', vim.diagnostic.setloclist)
|
||||||
|
|
||||||
|
vim.api.nvim_create_autocmd('LspAttach', {
|
||||||
|
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||||
|
callback = function(ev)
|
||||||
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
|
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||||
|
|
||||||
|
-- Buffer local mappings.
|
||||||
|
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||||
|
local opts = { buffer = ev.buf }
|
||||||
|
vim.keymap.set('n', '<leader>lD', vim.lsp.buf.declaration, opts)
|
||||||
|
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition, opts)
|
||||||
|
vim.keymap.set('n', '<leader>lk', vim.lsp.buf.hover, opts)
|
||||||
|
vim.keymap.set('n', '<leader>li', vim.lsp.buf.implementation, opts)
|
||||||
|
--vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||||
|
--vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||||
|
--vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||||
|
--vim.keymap.set('n', '<space>wl', function()
|
||||||
|
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||||
|
--end, opts)
|
||||||
|
vim.keymap.set('n', '<leader>ltd', vim.lsp.buf.type_definition, opts)
|
||||||
|
vim.keymap.set('n', '<leader>lrn', vim.lsp.buf.rename, opts)
|
||||||
|
vim.keymap.set({ 'n', 'v' }, '<leader>la', vim.lsp.buf.code_action, opts)
|
||||||
|
vim.keymap.set('n', '<leader>lrf', vim.lsp.buf.references, opts)
|
||||||
|
vim.keymap.set('n', '<space>lf', function()
|
||||||
|
vim.lsp.buf.format { async = true }
|
||||||
|
end, opts)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Attach lsp to completion engine
|
||||||
|
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||||
|
|
||||||
|
require("lspconfig").lua_ls.setup {
|
||||||
|
caplbilities = capabilities,
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = {
|
||||||
|
'vim',
|
||||||
|
'require'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
},
|
||||||
|
-- Do not send telemetry data containing a randomized but unique identifier
|
||||||
|
telemetry = {
|
||||||
|
enable = false,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
require("lspconfig").clangd.setup {capabilities = capabilities}
|
||||||
|
require("lspconfig").cmake.setup {capabilities = capabilities}
|
||||||
|
require("lspconfig").ltex.setup {capabilities = capabilities}
|
||||||
6
lua/core/plugin_config/lualine.lua
Normal file
6
lua/core/plugin_config/lualine.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
icons_enabled = true,
|
||||||
|
theme = 'gruvbox',
|
||||||
|
}
|
||||||
|
}
|
||||||
12
lua/core/plugin_config/nvim-tree.lua
Normal file
12
lua/core/plugin_config/nvim-tree.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
-- disable netrw at the very start of your init.lua
|
||||||
|
vim.g.loaded_netrw = 1
|
||||||
|
vim.g.loaded_netrwPlugin = 1
|
||||||
|
|
||||||
|
-- set termguicolors to enable highlight groups
|
||||||
|
vim.opt.termguicolors = true
|
||||||
|
|
||||||
|
-- empty setup using defaults
|
||||||
|
require("nvim-tree").setup()
|
||||||
|
|
||||||
|
-- keymap
|
||||||
|
vim.keymap.set("n", "<leader>n", ':NvimTreeFindFileToggle<CR>')
|
||||||
6
lua/core/plugin_config/telescope.lua
Normal file
6
lua/core/plugin_config/telescope.lua
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
local builtin = require('telescope.builtin')
|
||||||
|
|
||||||
|
vim.keymap.set('n', '<c-p>', builtin.find_files, {})
|
||||||
|
vim.keymap.set('n', '<leader><leader>', builtin.oldfiles, {})
|
||||||
|
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||||
|
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||||
11
lua/core/plugin_config/treesitter.lua
Normal file
11
lua/core/plugin_config/treesitter.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
require('nvim-treesitter.configs').setup({
|
||||||
|
-- list of languages to grab
|
||||||
|
ensure_installed = 'all',
|
||||||
|
|
||||||
|
-- how to install them
|
||||||
|
sync_install = false,
|
||||||
|
auto_install = true,
|
||||||
|
|
||||||
|
-- enable highlight
|
||||||
|
highlight = {enable = true}
|
||||||
|
})
|
||||||
40
lua/core/plugins.lua
Normal file
40
lua/core/plugins.lua
Normal file
|
|
@ -0,0 +1,40 @@
|
||||||
|
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||||
|
if not vim.loop.fs_stat(lazypath) then
|
||||||
|
vim.fn.system({
|
||||||
|
"git",
|
||||||
|
"clone",
|
||||||
|
"--filter=blob:none",
|
||||||
|
"https://github.com/folke/lazy.nvim.git",
|
||||||
|
"--branch=stable", -- latest stable release
|
||||||
|
lazypath,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
vim.opt.rtp:prepend(lazypath)
|
||||||
|
|
||||||
|
local plugins = {
|
||||||
|
'folke/lazy.nvim',
|
||||||
|
'ellisonleao/gruvbox.nvim',
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
'nvim-tree/nvim-web-devicons',
|
||||||
|
'nvim-lualine/lualine.nvim',
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
-- fzf
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
branch = "0.1.x",
|
||||||
|
dependencies = {{'nvim-lua/plenary.nvim'}}
|
||||||
|
},
|
||||||
|
-- Lsp
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
'neovim/nvim-lspconfig'
|
||||||
|
},
|
||||||
|
-- completion
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
}
|
||||||
|
|
||||||
|
local opts = {}
|
||||||
|
|
||||||
|
require("lazy").setup(plugins, opts)
|
||||||
133
plugins.vim
133
plugins.vim
|
|
@ -1,133 +0,0 @@
|
||||||
set nocompatible " be iMproved, required
|
|
||||||
filetype off " required
|
|
||||||
|
|
||||||
call plug#begin()
|
|
||||||
|
|
||||||
" Pretty
|
|
||||||
Plug 'itchyny/lightline.vim'
|
|
||||||
Plug 'morhetz/gruvbox'
|
|
||||||
Plug 'vim-scripts/ShowTrailingWhitespace'
|
|
||||||
"Plug 'Yggdroot/indentLine'
|
|
||||||
|
|
||||||
" Functional
|
|
||||||
Plug 'tpope/vim-fugitive'
|
|
||||||
Plug 'jiangmiao/auto-pairs'
|
|
||||||
Plug 'tpope/vim-surround'
|
|
||||||
"Plug 'dhruvasagar/vim-dotoo'
|
|
||||||
Plug 'vimwiki/vimwiki'
|
|
||||||
"Plug 'tools-life/taskwiki'
|
|
||||||
Plug 'sheerun/vim-polyglot'
|
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
|
||||||
Plug 'junegunn/fzf.vim'
|
|
||||||
" Language C++/glsl
|
|
||||||
"Plug 'ycm-core/YouCompleteMe'
|
|
||||||
Plug 'prabirshrestha/vim-lsp'
|
|
||||||
Plug 'mattn/vim-lsp-settings'
|
|
||||||
Plug 'prabirshrestha/asyncomplete.vim'
|
|
||||||
Plug 'tikhomirov/vim-glsl'
|
|
||||||
Plug 'mattn/calendar-vim'
|
|
||||||
|
|
||||||
call plug#end()
|
|
||||||
|
|
||||||
|
|
||||||
"Always show lightline
|
|
||||||
set laststatus=2
|
|
||||||
set showtabline=2
|
|
||||||
set noshowmode
|
|
||||||
|
|
||||||
" Gruvbox colours
|
|
||||||
let g:gruvbox_contrast_dark='hard'
|
|
||||||
let g:gruvbox_contrast_light='hard'
|
|
||||||
set background=dark
|
|
||||||
if has("termguicolors")
|
|
||||||
let g:gruvbox_termcolors=256
|
|
||||||
else
|
|
||||||
let g:gruvbox_termcolors=16
|
|
||||||
endif
|
|
||||||
"let g:gruvbox_improved_strings=1
|
|
||||||
let g:gruvbox_improved_warnings=1
|
|
||||||
let g:gruvbox_italic=1
|
|
||||||
colorscheme gruvbox
|
|
||||||
|
|
||||||
" Plugin leader mappings
|
|
||||||
|
|
||||||
" Tab completion
|
|
||||||
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
|
|
||||||
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
|
|
||||||
inoremap <expr> <cr> pumvisible() ? asyncomplete#close_popup() : "\<cr>"
|
|
||||||
|
|
||||||
" clangd vim lsp
|
|
||||||
function! s:on_lsp_buffer_enabled() abort
|
|
||||||
setlocal omnifunc=lsp#complete
|
|
||||||
setlocal signcolumn=yes
|
|
||||||
if exists('+tagfunc') | setlocal tagfunc=lsp#tagfunc | endif
|
|
||||||
nmap <buffer> <Leader>l? :echon " ld lsp-definition \n lrf lsp document reformat \n ls lsp document symbol search \n lS lsp workspace symbol search \n lr lsp references \n li lsp implementation \n lt lsp type definition \n lj lsp document diagnostics \n lrn lsp rename \n l[g lsp previous diagnostic \n l]g lsp next diagnostic \n lK lsp hover"<CR>
|
|
||||||
nmap <buffer> <leader>ld <plug>(lsp-definition)
|
|
||||||
nmap <buffer> <leader>lrf <plug>(lsp-document-reformat)
|
|
||||||
nmap <buffer> <leader>ls <plug>(lsp-document-symbol-search)
|
|
||||||
nmap <buffer> <leader>lS <plug>(lsp-workspace-symbol-search)
|
|
||||||
nmap <buffer> <leader>lr <plug>(lsp-references)
|
|
||||||
nmap <buffer> <leader>li <plug>(lsp-implementation)
|
|
||||||
nmap <buffer> <leader>lt <plug>(lsp-type-definition)
|
|
||||||
nmap <buffer> <leader>lj <plug>(lsp-document-diagnostics)
|
|
||||||
nmap <buffer> <leader>lrn <plug>(lsp-rename)
|
|
||||||
nmap <buffer> <leader>l[g <Plug>(lsp-previous-diagnostic)
|
|
||||||
nmap <buffer> <leader>l]g <Plug>(lsp-next-diagnostic)
|
|
||||||
nmap <buffer> <leader>lK <plug>(lsp-hover)
|
|
||||||
nmap <buffer> <leader>la <plug>(lsp-code-action-float)
|
|
||||||
|
|
||||||
let g:lsp_format_sync_timeout = 1000
|
|
||||||
autocmd! BufWritePre *.rs,*.go,*.cpp,*.c,*.h,*.cs,*.js,*.jsx,*.ts call execute('LspDocumentFormatSync')
|
|
||||||
|
|
||||||
" refer to doc to add more commands
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
augroup lsp_install
|
|
||||||
au!
|
|
||||||
" call s:on_lsp_buffer_enabled only for languages that has the server registered.
|
|
||||||
autocmd User lsp_buffer_enabled call s:on_lsp_buffer_enabled()
|
|
||||||
augroup END
|
|
||||||
|
|
||||||
" C++ Clangd if installed on system already
|
|
||||||
if executable('clangd')
|
|
||||||
augroup lsp_clangd
|
|
||||||
autocmd!
|
|
||||||
autocmd User lsp_setup call lsp#register_server({
|
|
||||||
\ 'name': 'clangd',
|
|
||||||
\ 'cmd': {server_info->['clangd']},
|
|
||||||
\ 'whitelist': ['h', 'c', 'cpp', 'objc', 'objcpp'],
|
|
||||||
\ })
|
|
||||||
autocmd FileType c setlocal omnifunc=lsp#complete
|
|
||||||
autocmd FileType cpp setlocal omnifunc=lsp#complete
|
|
||||||
autocmd FileType objc setlocal omnifunc=lsp#complete
|
|
||||||
autocmd FileType objcpp setlocal omnifunc=lsp#complete
|
|
||||||
augroup end
|
|
||||||
endif
|
|
||||||
|
|
||||||
" GLSL
|
|
||||||
autocmd! BufNewFile,BufRead *.vs,*.fs,*.glsl,*.frag,*.vert set ft=glsl
|
|
||||||
|
|
||||||
" Vimwiki
|
|
||||||
let g:vimwiki_list = [{'path': '~/.vimwiki/',
|
|
||||||
\ 'path_html': '~/.vimwiki/HTML',
|
|
||||||
\ 'auto_diary_index': 1,
|
|
||||||
\ 'syntax': 'markdown', 'ext': '.md',
|
|
||||||
\ 'links_space_char': '_',
|
|
||||||
\ 'vimwiki_use_calendar': 1}]
|
|
||||||
nnoremap <Leader>c :Calendar<CR>
|
|
||||||
|
|
||||||
" A little function to insert user input functionality into remaps
|
|
||||||
function! TagSearch()
|
|
||||||
call inputsave()
|
|
||||||
let replacement = input('Enter Tag: ')
|
|
||||||
call inputrestore()
|
|
||||||
execute ':VimwikiSearchTags '.replacement
|
|
||||||
execute ':lopen'
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
nmap <Leader>w? :echon " wts search-tags"<CR>
|
|
||||||
autocmd FileType vimwiki nmap <Leader>wts :call TagSearch()<CR>
|
|
||||||
|
|
||||||
" fzf git find
|
|
||||||
nnoremap <Leader>fg :GFiles<CR>
|
|
||||||
nnoremap <Leader>ff :Files<CR>
|
|
||||||
Loading…
Reference in a new issue