You are not logged in.

#1 2015-06-15 19:57:26

Psirus
Member
Registered: 2012-01-29
Posts: 45

Pcmanfm open with starts zsh instance instead of selected application

I'm trying to open text files and code with gvim by clicking on them in pcmanfm. In the "Open with" dialog, I selected "Vi Improved" from the applications list. When I now click on a text file, a zsh instance is started and consumes 100% CPU according to top. Once I kill this instance, gvim opens as expected. When running gvim from the terminal, everything works as expected.

I'm not really sure what's going on here, maybe a weird vim plugin? Here's my .vimrc:

set nocompatible 
filetype off

set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

" Plugin management:
Bundle 'gmarik/vundle'
Bundle "MarcWeber/vim-addon-mw-utils"
Bundle "tomtom/tlib_vim"
" Snippets
Bundle 'garbas/vim-snipmate'
" Syntax checking
Bundle 'scrooloose/syntastic'
" Orgmode
Bundle 'jceb/vim-orgmode'
" Airline
Bundle 'bling/vim-airline'
" Ack-Vim
Bundle 'mileszs/ack.vim'
" Align
Bundle 'junegunn/vim-easy-align'
" Tagbar
Bundle 'majutsushi/tagbar'
" Command T (commented out, because it creates segv; will look into it)
" Bundle 'wincent/command-t'
" LaTeX Syntax
Bundle 'gi1242/vim-tex-syntax'
" Undo Tree
Bundle 'mbbill/undotree'
" Text Linking needed for org-mode
Bundle 'vim-scripts/utl.vim'
Bundle 'tpope/vim-speeddating'
Bundle 'godlygeek/tabular'
Bundle 'plasticboy/vim-markdown'

nmap <F8> :TagbarToggle<CR>


syntax on
filetype plugin indent on 

colorscheme molokai
set enc=utf-8
" show overly long lines
set cc=80
let g:tex_flavor='latex'

set guifont=Droid\ Sans\ Mono\ for\ Powerline\ 10
let g:airline_powerline_fonts = 1
let g:airline#extensions#tabline#enabled = 1
" leave 10 lines at top/bottom while scrolling
set scrolloff=10
set shellcmdflag=-ic

" tabs are 4 spaces
set tabstop=4
set softtabstop=4
set shiftwidth=4
set expandtab

" au BufNewFile,BufRead *.md set filetype=markdown
let g:vim_markdown_folding_disabled=1
let g:vim_markdown_math=1

" write ~ and .swp wiles to tmp directory
set backupdir=~/.vim/tmp,.
set directory=~/.vim/tmp,.
" turn off gui thingies
set guioptions+=lLrmtT
set guioptions-=lLrmtT

set laststatus=2
let g:bufferline_echo = 0
let g:syntastic_mode_map = { 'mode': 'passive' }
let g:CommandTFileScanne = 'find'
set tags=./tags;
" remap tag following to ü (much better with German/Neo keyboard layout)
nnoremap ü <C-]>
nnoremap Ü <C-O>

" Start interactive EasyAlign in visual mode (e.g. vip<Enter>)
vmap <Enter> <Plug>(EasyAlign)
" Start interactive EasyAlign for a motion/text object (e.g. <Leader>aip)
nmap <Leader>a <Plug>(EasyAlign)

" For global replace
nnoremap gR gD:%s/<C-R>///gc<left><left><left>

map <silent> <F6> :!~/Studium/DA/build.py<CR>
map <silent> <F7> :!dict -d fd-deu-eng <cword><CR>
let fortran_fold = 1
let fortran_fold_conditionals = 1
let g:netrw_browsex_viewer= "xdg-open"

And my .zshrc for good measure:

# History
HISTFILE=~/.histfile
HISTSIZE=100000
SAVEHIST=100000
setopt appendhistory autocd HIST_IGNORE_DUPS
setopt nonomatch
setopt extended_glob
setopt no_bare_glob_qual

unsetopt beep

autoload -Uz compinit && compinit
autoload -U colors && colors
autoload -U zcalc

PROMPT="%{$fg_no_bold[red]%}%n|%1~» %{$reset_color%}"

if [[ "$TERM" != emacs ]]; then
    [[ -z "$terminfo[kdch1]" ]] || bindkey -M emacs "$terminfo[kdch1]" delete-char
    [[ -z "$terminfo[khome]" ]] || bindkey -M emacs "$terminfo[khome]" beginning-of-line
    [[ -z "$terminfo[kend]" ]] || bindkey -M emacs "$terminfo[kend]" end-of-line
    [[ -z "$terminfo[kich1]" ]] || bindkey -M emacs "$terminfo[kich1]" overwrite-mode
    [[ -z "$terminfo[kdch1]" ]] || bindkey -M vicmd "$terminfo[kdch1]" vi-delete-char
    [[ -z "$terminfo[khome]" ]] || bindkey -M vicmd "$terminfo[khome]" vi-beginning-of-line
    [[ -z "$terminfo[kend]" ]] || bindkey -M vicmd "$terminfo[kend]" vi-end-of-line
    [[ -z "$terminfo[kich1]" ]] || bindkey -M vicmd "$terminfo[kich1]" overwrite-mode
     
    [[ -z "$terminfo[cuu1]" ]] || bindkey -M viins "$terminfo[cuu1]" vi-up-line-or-history
    [[ -z "$terminfo[cuf1]" ]] || bindkey -M viins "$terminfo[cuf1]" vi-forward-char
    [[ -z "$terminfo[kcuu1]" ]] || bindkey -M viins "$terminfo[kcuu1]" vi-up-line-or-history
    [[ -z "$terminfo[kcud1]" ]] || bindkey -M viins "$terminfo[kcud1]" vi-down-line-or-history
    [[ -z "$terminfo[kcuf1]" ]] || bindkey -M viins "$terminfo[kcuf1]" vi-forward-char
    [[ -z "$terminfo[kcub1]" ]] || bindkey -M viins "$terminfo[kcub1]" vi-backward-char
     
    # ncurses fogyatekos
    [[ "$terminfo[kcuu1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcuu1]/O/[}" vi-up-line-or-history
    [[ "$terminfo[kcud1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcud1]/O/[}" vi-down-line-or-history
    [[ "$terminfo[kcuf1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcuf1]/O/[}" vi-forward-char
    [[ "$terminfo[kcub1]" == "^[O"* ]] && bindkey -M viins "${terminfo[kcub1]/O/[}" vi-backward-char
    [[ "$terminfo[khome]" == "^[O"* ]] && bindkey -M viins "${terminfo[khome]/O/[}" beginning-of-line
    [[ "$terminfo[kend]" == "^[O"* ]] && bindkey -M viins "${terminfo[kend]/O/[}" end-of-line
    [[ "$terminfo[khome]" == "^[O"* ]] && bindkey -M emacs "${terminfo[khome]/O/[}" beginning-of-line
    [[ "$terminfo[kend]" == "^[O"* ]] && bindkey -M emacs "${terminfo[kend]/O/[}" end-of-line
fi

# go up/down searching through the history with what you have typed so far
autoload -Uz up-line-or-beginning-search
autoload -Uz down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '\eOA' up-line-or-beginning-search
bindkey '\e[A' up-line-or-beginning-search
bindkey '\eOB' down-line-or-beginning-search
bindkey '\e[B' down-line-or-beginning-search

# Aliases
alias ls='ls --color=auto'
alias ll='ls -lh'
alias merge='git mergetool -t gvimdiff'
alias -s pdf='zathura'
alias -s jpg='viewnior'
alias tlmgr='sudo env PATH=$PATH tlmgr'
function gitsearch() {
    git grep "$*" $(git rev-list --all)
}

# path aliases
alias kuray='cd ~/Code/Python/kuray'

# make directory and change into it
function mcd() {
  mkdir -p "$1" && cd "$1";
}

# up 4 -> go 4 directories up (i.e cd ../../../..)
function up() {
    ups=""
    for i in $(seq 1 $1)
    do
    ups=$ups"../"
    done
    cd $ups
}

bindkey '^[[7~' vi-beginning-of-line   # Home
bindkey '^[[8~' vi-end-of-line         # End of Line
bindkey '^[[2~' beep                   # Insert
bindkey '^[[3~' delete-char            # Del
bindkey '^[[5~' vi-backward-blank-word # Page Up
bindkey '^[[6~' vi-forward-blank-word  # Page Down

function countdown(){
   date1=$((`date +%s` + $1)); 
   while [ "$date1" -ne `date +%s` ]; do 
     echo -ne "$(date -u --date @$(($date1 - `date +%s`)) +%H:%M:%S)\r";
     sleep 1
   done
}

Offline

#2 2015-06-16 00:02:13

Knute
Member
From: Minot, ND
Registered: 2009-03-17
Posts: 604

Re: Pcmanfm open with starts zsh instance instead of selected application

So do you have an entry for gvim as well?


Knute

Offline

#3 2015-06-16 04:36:15

Psirus
Member
Registered: 2012-01-29
Posts: 45

Re: Pcmanfm open with starts zsh instance instead of selected application

The entry links to /usr/share/applications/gvim.desktop, with it being

[Desktop Entry]
Name=Vi IMproved
MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;text/x-chdr;text/x-csrc;text/x-java;text/x-moc;text/x-pascal;text/x-tcl;text/x-tex;application/x-shellscript;text/x-c;text/x-c++;
Exec=gvim -f %F
Icon=gvim
Type=Application
Terminal=false
X-XClassHintResName=VIM
Categories=Utility;TextEditor;

So this should open gvim. And it does, once I kill the erroneous zsh-instance.

Last edited by Psirus (2015-06-16 05:11:48)

Offline

Board footer

Powered by FluxBB