chore: Archive vimrc

This commit is contained in:
Ahmad Ansori Palembani 2024-04-18 13:12:48 +07:00
parent 577be59f57
commit 7baae6f624
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
8 changed files with 0 additions and 0 deletions

View file

@ -1 +0,0 @@
autoload/

View file

@ -1,6 +0,0 @@
# null2264's VIM Configuration
## About
vimrc separated to multiple files to make it easier to maintain it on multiple OSes.
Right now this config only confirmed to be working on Linux.

View file

@ -1,9 +0,0 @@
" vim: filetype=vim
" augroup myvimrc
" au!
" au BufWritePost vim_idea so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
" augroup END
map <leader>r <Action>(RenameElement)
unmap <C-n>

View file

@ -1,78 +0,0 @@
" vim: filetype=vim
" ==============================
" Linux Specific Configuration
" ==============================
" ----- Cleaning up
set undodir=$XDG_DATA_HOME/vim/undo
set directory=$XDG_DATA_HOME/vim/swap
set backupdir=$XDG_DATA_HOME/vim/backup
set viewdir=$XDG_DATA_HOME/vim/view
if !has('nvim')
set viminfo+='1000,n$XDG_DATA_HOME/vim/viminfo
else
set viminfo+='1000,n$XDG_DATA_HOME/nvim/nviminfo
endif
set runtimepath=$XDG_CONFIG_HOME/vim,$VIMRUNTIME,$XDG_CONFIG_HOME/vim/after
if !has('nvim')
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
else
let $MYVIMRC="$XDG_CONFIG_HOME/nvim/init.lua"
endif
" ----- Mutt
au BufRead /tmp/mutt-* set tw=72
" ----- Execute corresponding language
" python
if !has("nvim")
autocmd FileType python map <buffer> <F9> :w<CR>:!clear; python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc>:w<CR>:!clear; python3 "%"<CR>
else
autocmd FileType python map <buffer> <F9> :w<CR>:vs<CR>:ter python3 "%"<CR>
autocmd FileType python imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter python3 "%"<CR>
endif
" sh (either bash or zsh)
autocmd FileType sh map <buffer> <F9> :w<CR>:vs<CR>:ter sh "%"<CR>
autocmd FileType sh imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter sh "%"<CR>
" c
autocmd FileType c map <buffer> <F9> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./%< && read<CR>
autocmd FileType c imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter gcc "%" -o %< && ./%< && read<CR>
" pandoc (markdown to pdf)
autocmd FileType markdown map <buffer> <F9> :w<CR>:!pandoc -o "%:r.pdf" -H ~/Documents/College/include.tex -c ~/Documents/College/pandoc_themes/buttondown.css "%" --from markdown+grid_tables+smart-implicit_figures --pdf-engine=xelatex<CR>
autocmd FileType markdown imap <buffer> <F9> <esc> :w<CR>:!pandoc -o "%:r.pdf" -H ~/Documents/College/include.tex -c ~/Documents/College/pandoc_themes/buttondown.css "%" --from markdown+grid_tables+smart-implicit_figures --pdf-engine=xelatex<CR>
" Open pdf via zathura if exist
autocmd FileType markdown map <leader>o :!setsid pdfview "%:r.pdf"<CR><CR>
" m (matlab/octave)
autocmd FileType matlab map <buffer> <F9> :w<CR>:vs<CR>:ter octave "%"<CR>
autocmd FileType matlab imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter octave "%"<CR>
" ruby
autocmd FileType ruby map <buffer> <F9> :w<CR>:vs<CR>:ter ruby "%"<CR>
autocmd FileType ruby imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter ruby "%"<CR>
" golang
autocmd FileType go map <buffer> <F9> :w<CR>:vs<CR>:ter go run "%"<CR>
autocmd FileType go imap <buffer> <F9> <esc> :w<CR>:vs<CR>:ter go run "%"<CR>
" ----- Automatically Render PDF
autocmd FileType plaintex command! -nargs=0 Lw w !pdflatex % > /dev/null
autocmd FileType tex command! -nargs=0 Lw w !pdflatex % > /dev/null
" ----- Install plug (Plugin Manager)
if empty(glob('~/.config/vim/autoload/plug.vim'))
silent !curl -fLo ~/.config/vim/autoload/plug.vim --create-dirs
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
" - Lf Shortcut
" let g:lf_map_keys = 0
" map <C-n> :Lf<CR>
" - exit if only nerdtree left
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif

View file

@ -1,418 +0,0 @@
" vim: filetype=vim
" ==============================
" VIM-Plug - Plugin Manager
" ==============================
" ===== Vim Plugin Directory (Changes required for Windows user)
let $vimplug_bundle='~/.local/share/vim/bundle'
" let $vimplug_bundle='c:\_local\share\vim\bundle'
" ===== List of used plugins
call plug#begin($vimplug_bundle)
" === Highlightings
" --- Syntax highlighting for ps1 (PowerShell)
Plug 'PProvost/vim-ps1'
" --- For sxhkd config file
Plug 'kovetskiy/sxhkd-vim'
" --- For LaTeX
Plug 'lervag/vimtex'
" ======
" --- Goyo, simplified view for vim useful when writing long documents
Plug 'junegunn/goyo.vim'
" --- Line at the bottom of vim, just to make it look nice
Plug 'itchyny/lightline.vim'
" --- Comment a line in one press of a button (or 2 button)
Plug 'tpope/vim-commentary'
" === NERDTree
" --- Navigate through files/folder while in vim
Plug 'preservim/nerdtree'
" --- Icon for nerdtree
Plug 'ryanoasis/vim-devicons'
" --- Tell everyone on discord that you use vim!
" Plug 'hugolgst/vimsence'
" ======
" -- Markdown preview, not really useful since it's only support github's md format.
Plug 'iamcco/markdown-preview.nvim', { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
" --- Auto complete with NCM2 (nvim-completion-manager)
" Plug 'ncm2/ncm2'
" Plug 'roxma/nvim-yarp'
" - NCM2 sources
" Plug 'ncm2/ncm2-jedi' " python
" Plug 'ncm2/ncm2-racer' " rust
" --- nvm built-in lsp
Plug 'neovim/nvim-lspconfig'
" --- Auto complete with DDC
" Plug 'Shougo/ddc.vim', { 'branch': 'main' }
" Plug 'vim-denops/denops.vim', { 'branch': 'main' }
" " - DDC sources
" Plug 'Shougo/ddc-around', { 'branch': 'main' }
" Plug 'Shougo/ddc-nvim-lsp', { 'branch': 'main' }
" " - DDC filters
" Plug 'Shougo/ddc-matcher_head', { 'branch': 'main' }
" Plug 'Shougo/ddc-sorter_rank', { 'branch': 'main' }
" --- Auto complete with CMP
Plug 'hrsh7th/cmp-nvim-lsp', { 'branch': 'main' }
Plug 'hrsh7th/cmp-buffer', { 'branch': 'main' }
Plug 'hrsh7th/cmp-path', { 'branch': 'main' }
Plug 'hrsh7th/cmp-cmdline', { 'branch': 'main' }
Plug 'hrsh7th/nvim-cmp', { 'branch': 'main' }
" --- Indent visualization
" Plug 'Yggdroot/indentLine'
" --- sqlite
" Plug 'lbrayner/dbext.vim'
" --- Julia support
Plug 'JuliaEditorSupport/julia-vim'
" --- enhanced python highlighting
"Plug 'wookayin/semshi', {'do': ':UpdateRemotePlugins'}
" --- For golang
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
" --- linting support
Plug 'dense-analysis/ale'
" --- For rust
Plug 'rust-lang/rust.vim'
Plug 'wakatime/vim-wakatime'
Plug 'GutenYe/json5.vim'
" --- Project Fluent support
Plug 'projectfluent/fluent.vim'
" --- AIO solution for highlighting
Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'https://git.sr.ht/~mango/tree-sitter-gsp'
call plug#end()
" ======================
" PlugIns Configuration
" ======================
" --- deoplete
" let g:deoplete#enable_at_startup = 1
" inoremap <expr><tab> pumvisible() ? "\<c-n>" : "\<tab>"
" call deoplete#custom#option('ignore_sources', {'_': ['around', 'buffer']})
" " imap <tab> <Plug>snipMateNextOrTrigger
" " omnifuncs
" augroup omnifuncs
" autocmd!
" autocmd FileType css setlocal omnifunc=csscomplete#CompleteCSS
" autocmd FileType html,markdown setlocal omnifunc=htmlcomplete#CompleteTags
" autocmd FileType javascript setlocal omnifunc=javascriptcomplete#CompleteJS
" autocmd FileType python setlocal omnifunc=pythoncomplete#Complete
" autocmd FileType xml setlocal omnifunc=xmlcomplete#CompleteTags
" augroup end
" --- NCM2
" autocmd BufEnter * call ncm2#enable_for_buffer()
" set completeopt=noinsert,menuone,noselect
" " suppress the annoying 'match x of y', 'The only match' and 'Pattern not
" " found' messages
" set shortmess+=c
" " CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead.
" inoremap <c-c> <ESC>
" " When the <Enter> key is pressed while the popup menu is visible, it only
" " hides the menu. Use this mapping to close the menu and also start a new
" " line.
" inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
" " Use <TAB> to select the popup menu:
" inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
" inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" " wrap existing omnifunc
" " Note that omnifunc does not run in background and may probably block the
" " editor. If you don't want to be blocked by omnifunc too often, you could
" " add 180ms delay before the omni wrapper:
" " 'on_complete': ['ncm2#on_complete#delay', 180,
" " \ 'ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
" au User Ncm2Plugin call ncm2#register_source({
" \ 'name' : 'css',
" \ 'priority': 9,
" \ 'subscope_enable': 1,
" \ 'scope': ['css','scss'],
" \ 'mark': 'css',
" \ 'word_pattern': '[\w\-]+',
" \ 'complete_pattern': ':\s*',
" \ 'on_complete': ['ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
" \ })
" --- NERDTree
let NERDTreeShowHidden=1
let NERDTreeMinimalUI = 1
" --- Snippet
" let g:UltiSnipsExpandTrigger="<C-Tab>"
" let g:UltiSnipsJumpForwardTrigger="<C-Tab>"
" let g:UltiSnipsJumpBackwardTrigger="<S-Tab>"
" let g:UltiSnipsEditSplit="vertical"
" --- lightline
set laststatus=2
let g:lightline = {
\'colorscheme': 'zi',
\'active': {
\ 'left': [
\ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'fugitive', 'readonly', 'filename', 'modified' ]
\ ],
\ 'right': [
\ [ 'lineinfo' ],
\ [ 'percent' ],
\ [ 'fileformat', 'fileencoding', 'filetype', ]
\ ]
\},
\'component': {
\ 'lineinfo': ' %2l:%-2v%<',
\ 'percent': '☰ %2p%%',
\},
\'component_function': {
\ 'gitbranch': 'FugitiveHead',
\ 'fugitive': 'LightlineFugitive',
\ 'filename': 'LightlineFilename'
\},
\ }
set noshowmode
" function for lightline
function! LightlineFugitive()
if &ft !~? 'vimfiler' && exists('*FugitiveHead')
return FugitiveHead()
endif
return ''
endfunction
function! LightlineFilename()
let root = fnamemodify(get(b:, 'git_dir'), ':h')
let path = expand('%:p')
if path[:len(root)-1] ==# root
return path[len(root)+1:]
endif
return expand('%')
endfunction
" no lightline on nerdtree
augroup filetype_nerdtree
au!
au FileType nerdtree call s:disable_lightline_on_nerdtree()
au WinEnter,BufWinEnter,TabEnter * call s:disable_lightline_on_nerdtree()
augroup END
fu s:disable_lightline_on_nerdtree() abort
let nerdtree_winnr = index(map(range(1, winnr('$')), {_,v -> getbufvar(winbufnr(v), '&ft')}), 'nerdtree') + 1
call timer_start(0, {-> nerdtree_winnr && setwinvar(nerdtree_winnr, '&stl', '%#Normal#')})
endfu
" --- Custom comments
autocmd FileType xdefaults setlocal commentstring=!\ %s
" --- Indent visualization
let g:indentLine_setColors = 0
let g:indentLine_leadingSpaceEnabled = 1
let g:indentLine_leadingSpaceChar = '·'
hi Conceal ctermfg=0 ctermbg=NONE
" --- Python highlighting
let g:python_highlight_all = 1
" --- DDC
" " Customize global settings
" " Use around source.
" " https://github.com/Shougo/ddc-around
" call ddc#custom#patch_global('sources', ['around', 'nvim-lsp'])
" " Use matcher_head and sorter_rank.
" " https://github.com/Shougo/ddc-matcher_head
" " https://github.com/Shougo/ddc-sorter_rank
" call ddc#custom#patch_global('sourceOptions', {
" \ '_': {
" \ 'matchers': ['matcher_head'],
" \ 'sorters': ['sorter_rank']},
" \ })
" " Change source options
" call ddc#custom#patch_global('sourceOptions', {
" \ 'around': {'mark': 'A'},
" \ 'nvim-lsp': { 'mark': 'lsp', 'forceCompletionPattern': '\.|:|->' },
" \ })
" call ddc#custom#patch_global('sourceParams', {
" \ 'around': {'maxSize': 500},
" \ 'nvim-lsp': { 'kindLabels': { 'Class': 'c' } },
" \ })
" " Customize settings on a filetype
" call ddc#custom#patch_filetype(['rust'], 'sources', ['around', 'nvim-lsp'])
" call ddc#custom#patch_filetype(['c', 'cpp'], 'sources', ['around', 'clangd'])
" call ddc#custom#patch_filetype(['c', 'cpp'], 'sourceOptions', {
" \ 'clangd': {'mark': 'C'},
" \ })
" call ddc#custom#patch_filetype('markdown', 'sourceParams', {
" \ 'around': {'maxSize': 100},
" \ })
" " Mappings
" " <TAB>: completion.
" inoremap <silent><expr> <TAB>
" \ pumvisible() ? '<C-n>' :
" \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ?
" \ '<TAB>' : ddc#manual_complete()
" " <S-TAB>: completion back.
" inoremap <expr><S-TAB> pumvisible() ? '<C-p>' : '<C-h>'
" " Use ddc.
" call ddc#enable()
" --- nvim-lsp
lua << EOF
local nvim_lsp = require'lspconfig'
nvim_lsp.pyright.setup{}
-- nvim_lsp.jedi_language_server.setup{}
nvim_lsp.rust_analyzer.setup({
settings = {
["rust-analyzer"] = {
assist = {
importGranularity = "module",
importPrefix = "by_self",
},
cargo = {
loadOutDirsFromCheck = true
},
procMacro = {
enable = true
},
}
}
})
EOF
" --- ale
let g:ale_fixers = {
\ "python": ["black"],
\}
let g:ale_linters = {
\ "python": ["pflake8", "black"],
\}
" --- CMP
lua <<EOF
-- Setup nvim-cmp.
local cmp = require'cmp'
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil
end
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
-- vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end,
},
window = {
-- completion = cmp.config.window.bordered(),
-- documentation = cmp.config.window.bordered(),
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-Space>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
['<CR>'] = cmp.mapping(function(fallback)
if cmp.visible() and not cmp.confirm() then
cmp.abort()
else
fallback()
end
end, {"i", "s"}),
["<Tab>"] = cmp.mapping(function(fallback)
if cmp.visible() then
cmp.select_next_item()
-- elseif has_words_before() then
-- cmp.complete()
else
fallback() -- The fallback function sends a already mapped key. In this case, it's probably `<Tab>`.
end
end, { "i", "s" }),
["<S-Tab>"] = cmp.mapping(function()
if cmp.visible() then
cmp.select_prev_item()
end
end, { "i", "s" }),
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
-- { name = 'vsnip' }, -- For vsnip users.
-- { name = 'luasnip' }, -- For luasnip users.
-- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = 'snippy' }, -- For snippy users.
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
-- Setup lspconfig.
local capabilities = require('cmp_nvim_lsp').default_capabilities()
-- Replace <YOUR_LSP_SERVER> with each lsp server you've enabled.
require('lspconfig')['pyright'].setup {
capabilities = capabilities
}
EOF
" --- TSTree
lua require'nvim-treesitter.configs'.setup{highlight={enable=true}}

View file

@ -1,147 +0,0 @@
" vim: filetype=vim
" ==============================
" Universal (Works on any OS... probably) Configuration
" ==============================
" ----- Vim Initial Config
set encoding=utf-8
set hls
set number relativenumber " -- converted
set ignorecase
set smartcase
set mouse=a
set background=dark
set ffs=unix
" set complete+=kspell
" set completeopt=menuone,longest
" set list lcs=trail:·,tab:··\|,nbsp:·
hi VertSplit cterm=NONE ctermbg=0 ctermfg=0
hi NonText ctermfg=0
hi Folded ctermfg=White
hi Folded ctermbg=Black
" hi! EndOfBuffer ctermbg=NONE ctermfg=8
set fillchars=eob:\
syntax on
filetype indent plugin on
" -- converted
map <C-n> :NERDTreeToggle<CR>
let mapleader=" " " -- converted
set guifont=Iosevka:h15 " -- converted
" ----- Folding stuff
set foldnestmax=10
" don't fold by default
set nofoldenable
set foldlevel=1
" python
autocmd FileType python setlocal foldmethod=indent
" ----- Mapping
" Norm but in shortcut -- converted
vnoremap . :normal .<CR>
" Map ctrl + u as U -- converted
noremap <C-u> U
" Map U as redo (ctrl + r) -- converted
noremap U <C-r>
" Yank and Put to/from clipboard/primary -- converted
noremap <C-y> "+y
noremap <C-p> "+p
noremap <C-Y> "+y
noremap <C-P> "+P
" Shortcut to comment a line -- converted
map <C-/> gcc
vmap <C-/> gc
imap <C-/> <esc>gc
" Clear last search result
map <leader>c :noh<CR>
" TwiddleCase
function! TwiddleCase(str)
if a:str ==# toupper(a:str)
let result = tolower(a:str)
elseif a:str ==# tolower(a:str)
let result = substitute(a:str,'\(\<\w\+\>\)', '\u\1', 'g')
else
let result = toupper(a:str)
endif
return result
endfunction
vnoremap ~ y:call setreg('', TwiddleCase(@"), getregtype(''))<CR>gv""Pgv
" Format with by pressing Q useful for markdown / other markup languages
map Q gq
" ----- 'vim -b' = edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
" ----- indent for corresponding extension
autocmd BufEnter *.py set ai sw=4 ts=4 sta et fo=croql
" in C files, tabs looks like 4 spaces, but it's actually tabs
autocmd Filetype c set ai sw=4 ts=4 sta noet fo=croql
autocmd BufEnter *.md set ai sw=3 ts=3 sta et fo=croql
autocmd Filetype html* set ai sw=4 ts=4 sta et fo=croql
autocmd Filetype *css set ai sw=4 ts=4 sta et fo=croql
autocmd Filetype javascript* set ai sw=4 ts=4 sta et fo=croql
autocmd Filetype json set ai sw=4 ts=4 sta et fo=croql
autocmd Filetype vue set ai sw=4 ts=4 sta et fo=croql
autocmd Filetype php set ai sw=4 ts=4 sta et fo=croql
" ----- Auto refresh vimrc
augroup myvimrc
au!
au BufWritePost vimrc so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
au BufWritePost vim_nix so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
au BufWritePost vim_plug so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
au BufWritePost vim_uni so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
au BufWritePost vim_win so $MYVIMRC | if has('gui_running') | so $MYGVIMRC | endif
augroup END
" ----- Discord Rich Presences API
let g:vimsence_client_id = '733622032901603388'
let g:vimsence_small_text = 'Neovim'
let g:vimsence_small_image = 'nvim'
" let g:vimsence_large_image = 'ts'
let g:vimsence_editing_details = 'Editing {}'
let g:vimsence_editing_state = 'Workspace: {}'
let g:vimsence_file_explorer_text = 'In NERDTree'
let g:vimsence_file_explorer_details = 'Looking for files'
" Split opens at the bottom and right
set splitbelow splitright
" Split navigation shortcuts
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Complete menu mappings
" Up and Down act like ctrl+p and ctrl+n
inoremap <expr><Up> pumvisible() ? "<C-p>" : "<Up>"
inoremap <expr><Down> pumvisible() ? "<C-n>" : "<Down>"
" Enter to complete
inoremap <expr><CR> pumvisible() ? "<C-y>" : "<CR>"
" Left or Right to cancel
" inoremap <expr><Right> pumvisible() ? "<C-e><Right>" : "<Right>"
" inoremap <expr><Left> pumvisible() ? "<C-e><Left>" : "<Left>"
" Tab act like ctrl+p and ctrl+n
inoremap <expr><Tab> pumvisible() ? "<C-n>" : "<Tab>"
inoremap <expr><S-Tab> pumvisible() ? "<C-p>" : "<S-Tab>"

View file

@ -1,17 +0,0 @@
" vim: filetype=vim
" ==============================
" Windows Specific Configuration
" ==============================
" ----- Cleaning up
let $MYVIMRC="C:\_config\vim\vimrc"
" ----- Install plug (Plugin Manager)
md ~\AppData\Local\nvim-data\site\autoload
$uri = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
(New-Object Net.WebClient).DownloadFile(
$uri,
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath(
"~\AppData\Local\nvim-data\site\autoload\plug.vim"
)
)

View file

@ -1,37 +0,0 @@
" vim: filetype=vim
"
" ========================================
" ::-----------------------:
" .--------------------------:
" :---------------:--------:
" :------.
" :------.
" .------: .:::
" ------: :-----
" :------. -----.
" .------: ...
" .------: .::.
" :------. :----:
" .------. :------.
" .------: .------.
" .------: .------:
" :-------:::::::::::------.
" :-----------------------:
" .---------------------:
" ========================================
" null2264's NeoVim Config
" ========================================
if !has('nvim') || !has('win64') || !has('win32') || !has('win16')
let $ZVIM_CONFIG_DIR = "~/.config/vim"
let $ZVIM_OS_TYPE = "nix"
so $ZVIM_CONFIG_DIR/vim_$ZVIM_OS_TYPE
so $ZVIM_CONFIG_DIR/vim_uni
if !exists('g:vscode')
source $ZVIM_CONFIG_DIR/vim_plug
endif
else
echoerr "Only NeoVim on POSIX OS is supported!"
endif