+ [2 files changed]

* Removed mcpelauncher scripts (mcpe on linux is ded, thx mojang)
* Re-added EDITOR env (still used by other command)
* Migration from NCM2 to DDC+nvimlsp
This commit is contained in:
ziro 2022-07-03 12:58:30 +07:00
parent eed95afc24
commit 98395e5ad5
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
4 changed files with 105 additions and 180 deletions

View file

@ -62,22 +62,22 @@ Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app & yarn install' }
" Plug 'deoplete-plugins/deoplete-jedi' " Plug 'deoplete-plugins/deoplete-jedi'
" --- Auto complete with NCM2 (nvim-completion-manager) " --- Auto complete with NCM2 (nvim-completion-manager)
Plug 'ncm2/ncm2' " Plug 'ncm2/ncm2'
Plug 'roxma/nvim-yarp' " Plug 'roxma/nvim-yarp'
" - NCM2 sources " - NCM2 sources
Plug 'ncm2/ncm2-jedi' " python " Plug 'ncm2/ncm2-jedi' " python
Plug 'ncm2/ncm2-racer' " rust " Plug 'ncm2/ncm2-racer' " rust
" --- Auto complete with DDC " --- Auto complete with DDC
" Plug 'Shougo/ddc.vim' Plug 'Shougo/ddc.vim', { 'branch': 'main' }
" Plug 'vim-denops/denops.vim' Plug 'vim-denops/denops.vim', { 'branch': 'main' }
" Plug 'neovim/nvim-lspconfig' Plug 'neovim/nvim-lspconfig'
" " - DDC sources " - DDC sources
" Plug 'Shougo/ddc-around' Plug 'Shougo/ddc-around', { 'branch': 'main' }
" Plug 'Shougo/ddc-nvim-lsp' Plug 'Shougo/ddc-nvim-lsp', { 'branch': 'main' }
" " - DDC filters " - DDC filters
" Plug 'Shougo/ddc-matcher_head' Plug 'Shougo/ddc-matcher_head', { 'branch': 'main' }
" Plug 'Shougo/ddc-sorter_rank' Plug 'Shougo/ddc-sorter_rank', { 'branch': 'main' }
" --- Indent visualization " --- Indent visualization
" Plug 'Yggdroot/indentLine' " Plug 'Yggdroot/indentLine'
@ -126,41 +126,41 @@ call plug#end()
" augroup end " augroup end
" --- NCM2 " --- NCM2
autocmd BufEnter * call ncm2#enable_for_buffer() " autocmd BufEnter * call ncm2#enable_for_buffer()
set completeopt=noinsert,menuone,noselect " set completeopt=noinsert,menuone,noselect
" suppress the annoying 'match x of y', 'The only match' and 'Pattern not " " suppress the annoying 'match x of y', 'The only match' and 'Pattern not
" found' messages " " found' messages
set shortmess+=c " set shortmess+=c
" CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead. " " CTRL-C doesn't trigger the InsertLeave autocmd . map to <ESC> instead.
inoremap <c-c> <ESC> " inoremap <c-c> <ESC>
" When the <Enter> key is pressed while the popup menu is visible, it only " " 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 " " hides the menu. Use this mapping to close the menu and also start a new
" line. " " line.
inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>") " inoremap <expr> <CR> (pumvisible() ? "\<c-y>\<cr>" : "\<CR>")
" Use <TAB> to select the popup menu: " " Use <TAB> to select the popup menu:
inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>" " inoremap <expr> <Tab> pumvisible() ? "\<C-n>" : "\<Tab>"
inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>" " inoremap <expr> <S-Tab> pumvisible() ? "\<C-p>" : "\<S-Tab>"
" wrap existing omnifunc " " wrap existing omnifunc
" Note that omnifunc does not run in background and may probably block the " " 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 " " editor. If you don't want to be blocked by omnifunc too often, you could
" add 180ms delay before the omni wrapper: " " add 180ms delay before the omni wrapper:
" 'on_complete': ['ncm2#on_complete#delay', 180, " " 'on_complete': ['ncm2#on_complete#delay', 180,
" \ 'ncm2#on_complete#omni', 'csscomplete#CompleteCSS'], " " \ 'ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
au User Ncm2Plugin call ncm2#register_source({ " au User Ncm2Plugin call ncm2#register_source({
\ 'name' : 'css', " \ 'name' : 'css',
\ 'priority': 9, " \ 'priority': 9,
\ 'subscope_enable': 1, " \ 'subscope_enable': 1,
\ 'scope': ['css','scss'], " \ 'scope': ['css','scss'],
\ 'mark': 'css', " \ 'mark': 'css',
\ 'word_pattern': '[\w\-]+', " \ 'word_pattern': '[\w\-]+',
\ 'complete_pattern': ':\s*', " \ 'complete_pattern': ':\s*',
\ 'on_complete': ['ncm2#on_complete#omni', 'csscomplete#CompleteCSS'], " \ 'on_complete': ['ncm2#on_complete#omni', 'csscomplete#CompleteCSS'],
\ }) " \ })
" --- NERDTree " --- NERDTree
let NERDTreeShowHidden=1 let NERDTreeShowHidden=1
@ -238,76 +238,76 @@ hi Conceal ctermfg=0 ctermbg=NONE
let g:python_highlight_all = 1 let g:python_highlight_all = 1
" --- DDC " --- DDC
" " Customize global settings " Customize global settings
" " Use around source. " Use around source.
" " https://github.com/Shougo/ddc-around " https://github.com/Shougo/ddc-around
" call ddc#custom#patch_global('sources', ['around', 'nvimlsp']) call ddc#custom#patch_global('sources', ['around', 'nvim-lsp'])
" " Use matcher_head and sorter_rank. " Use matcher_head and sorter_rank.
" " https://github.com/Shougo/ddc-matcher_head " https://github.com/Shougo/ddc-matcher_head
" " https://github.com/Shougo/ddc-sorter_rank " https://github.com/Shougo/ddc-sorter_rank
" call ddc#custom#patch_global('sourceOptions', { call ddc#custom#patch_global('sourceOptions', {
" \ '_': { \ '_': {
" \ 'matchers': ['matcher_head'], \ 'matchers': ['matcher_head'],
" \ 'sorters': ['sorter_rank']}, \ 'sorters': ['sorter_rank']},
" \ }) \ })
" " Change source options " Change source options
" call ddc#custom#patch_global('sourceOptions', { call ddc#custom#patch_global('sourceOptions', {
" \ 'around': {'mark': 'A'}, \ 'around': {'mark': 'A'},
" \ 'nvimlsp': { 'mark': 'lsp', 'forceCompletionPattern': '\.|:|->' }, \ 'nvim-lsp': { 'mark': 'lsp', 'forceCompletionPattern': '\.|:|->' },
" \ }) \ })
" call ddc#custom#patch_global('sourceParams', { call ddc#custom#patch_global('sourceParams', {
" \ 'around': {'maxSize': 500}, \ 'around': {'maxSize': 500},
" \ 'nvimlsp': { 'kindLabels': { 'Class': 'c' } }, \ 'nvim-lsp': { 'kindLabels': { 'Class': 'c' } },
" \ }) \ })
" " Customize settings on a filetype " Customize settings on a filetype
" call ddc#custom#patch_filetype(['rust'], 'sources', ['around', 'nvimlsp']) 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'], 'sources', ['around', 'clangd'])
" call ddc#custom#patch_filetype(['c', 'cpp'], 'sourceOptions', { call ddc#custom#patch_filetype(['c', 'cpp'], 'sourceOptions', {
" \ 'clangd': {'mark': 'C'}, \ 'clangd': {'mark': 'C'},
" \ }) \ })
" call ddc#custom#patch_filetype('markdown', 'sourceParams', { call ddc#custom#patch_filetype('markdown', 'sourceParams', {
" \ 'around': {'maxSize': 100}, \ 'around': {'maxSize': 100},
" \ }) \ })
" " Mappings " Mappings
" " <TAB>: completion. " <TAB>: completion.
" inoremap <silent><expr> <TAB> inoremap <silent><expr> <TAB>
" \ pumvisible() ? '<C-n>' : \ pumvisible() ? '<C-n>' :
" \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ? \ (col('.') <= 1 <Bar><Bar> getline('.')[col('.') - 2] =~# '\s') ?
" \ '<TAB>' : ddc#manual_complete() \ '<TAB>' : ddc#manual_complete()
" " <S-TAB>: completion back. " <S-TAB>: completion back.
" inoremap <expr><S-TAB> pumvisible() ? '<C-p>' : '<C-h>' inoremap <expr><S-TAB> pumvisible() ? '<C-p>' : '<C-h>'
" " Use ddc. " Use ddc.
" call ddc#enable() call ddc#enable()
" --- nvim-lsp " --- nvim-lsp
" lua << EOF lua << EOF
" require'lspconfig'.pyright.setup{} local nvim_lsp = require'lspconfig'
" local nvim_lsp = require'lspconfig'
" nvim_lsp.rust_analyzer.setup({ nvim_lsp.pyright.setup{}
" settings = { nvim_lsp.rust_analyzer.setup({
" ["rust-analyzer"] = { settings = {
" assist = { ["rust-analyzer"] = {
" importGranularity = "module", assist = {
" importPrefix = "by_self", importGranularity = "module",
" }, importPrefix = "by_self",
" cargo = { },
" loadOutDirsFromCheck = true cargo = {
" }, loadOutDirsFromCheck = true
" procMacro = { },
" enable = true procMacro = {
" }, enable = true
" } },
" } }
" }) }
" EOF })
EOF
" --- ale " --- ale
let g:ale_fixers = { let g:ale_fixers = {

View file

@ -35,8 +35,10 @@ export XMODIFIERS=@im="ibus"
export QT_QPA_PLATFORMTHEME="qt5ct" export QT_QPA_PLATFORMTHEME="qt5ct"
if [[ -n $SSH_CONNECTION ]]; then if [[ -n $SSH_CONNECTION ]]; then
export VISUAL="vim" export VISUAL="vim"
export EDITOR="vim"
else else
export VISUAL="nvim" export VISUAL="nvim"
export EDITOR="nvim"
fi fi
export BROWSER="librewolf" export BROWSER="librewolf"
# export BROWSER="waterfox-g3" # export BROWSER="waterfox-g3"

View file

@ -1,7 +0,0 @@
#!/bin/sh
version=$(find ~/.local/share/mcpelauncher/versions -maxdepth 1 | sort -r | awk '!/ns$/ && !/.ini/' | sed "s/^.*s\///" | dmenu -l 10 -i -p "MCPE Versions")
[ -z $version ] && exit 1
gamemoderun mcpelauncher-client -ww 1366 -wh 740 -dg ~/.local/share/mcpelauncher/versions/$version &
sleep 5s && mcpelauncher-rpc "$version"

View file

@ -1,70 +0,0 @@
#!/usr/bin/env python3
import sys, getopt, pypresence, time, psutil
from subprocess import check_output
# ----- RPC Client ID
RPC = pypresence.Presence("731745989039489036")
# ----- Functions
def get_pid(name):
return map(int,check_output(["pidof","-s",name]).split())
def connect_rpc():
while True:
try:
RPC.connect()
break
except ConnectionRefusedError as e:
print("Failed to connect to RPC! Trying again in 10 seconds...")
time.sleep(10)
except (FileNotFoundError, AttributeError) as e:
print("RPC failed to connect due to Discord not being opened yet.")
time.sleep(10)
def check_mcbe():
# get_pid("mcpelauncher-client")
return 'MINECRAFT MAIN ' in (p.name() for p in psutil.process_iter())
def update_rpc():
RPC.update(details=mcbe_game, large_image='minecraft', large_text=mcbe_ltext, small_image='world', small_text=mcbe_stext, start=start_time)
if debug is True:
print(color.BOLD + '[ ' + color.END + color.GREEN + 'OK' + color.END + color.BOLD + ' ] ' + color.END + 'RPC has been updated.')
time.sleep(5)
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
END = '\033[0m'
# ----- Command-Line Arguments + Config
debug=False
mcbe_version=str(sys.argv[1])
mcbe_game=str("v" + mcbe_version)
mcbe_ltext=str("Using Linux MCPE Launcher")
mcbe_ign="Zerogame1432"
mcbe_stext="IGN: " + mcbe_ign
start_time=int(time.time())
# ----- Connect to RPC
connect_rpc()
# ----- Loops
while True:
try:
if check_mcbe() == True or debug == True:
update_rpc()
else:
print(color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'Minecraft is not running')
RPC.close
break
except KeyboardInterrupt as kb:
print('\n' + color.BOLD + '[ ' + color.END + color.RED + 'ERROR' + color.END + color.BOLD + ' ] ' + color.END + 'RPC interrupted, closing...')
RPC.close
break