Search Results

Search found 1146 results on 46 pages for 'completion'.

Page 1/46 | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Bash Completion Script Help

    - by inxilpro
    So I'm just starting to learn about bash completion scripts, and I started to work on one for a tool I use all the time. First I built the script using a set list of options: _zf_comp() { local cur prev actions COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" actions="change configure create disable enable show" COMPREPLY=($(compgen -W "${actions}" -- ${cur})) return 0 } complete -F _zf_comp zf This works fine. Next, I decided to dynamically create the list of available actions. I put together the following command: zf | grep "Providers and their actions:" -A 100 | grep -P "^\s*\033\[36m\s*zf" | awk '{gsub(/[[:space:]]*/, "", $3); print $3}' | sort | uniq | awk '{sub("\-", "\\-", $1); print $1}' | tr \\n " " | sed 's/^ *\(.*\) *$/\1/' Which basically does the following: Grabs all the text in the "zf" command after "Providers and their actions:" Grabs all the lines that start with "zf" (I had to do some fancy work here 'cause the ZF command prints in color) Grab the second piece of the command and remove any spaces from it (the spaces part is probably not needed any more) Sort the list Get rid of any duplicates Escape dashes (I added this when trying to debug the problem—probably not needed) Trim all new lines Trim all leading and ending spaces The above command produces: $ zf | grep "Providers and their actions:" -A 100 | grep -P "^\s*\033\[36m\s*zf" | awk '{gsub(/[[:space:]]*/, "", $3); print $3}' | sort | uniq | awk '{sub("\-", "\\-", $1); print $1}' | tr \\n " " | sed 's/^ *\(.*\) *$/\1/' change configure create disable enable show $ So it looks to me like it's producing the exact same string as I had in my original script. But when I do: _zf_comp() { local cur prev actions COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" actions=`zf | grep "Providers and their actions:" -A 100 | grep -P "^\s*\033\[36m\s*zf" | awk '{gsub(/[[:space:]]*/, "", $3); print $3}' | sort | uniq | awk '{sub("\-", "\\-", $1); print $1}' | tr \\n " " | sed 's/^ *\(.*\) *$/\1/'` COMPREPLY=($(compgen -W "${actions}" -- ${cur})) return 0 } complete -F _zf_comp zf My autocompletion starts acting up. First, it won't autocomplete anything with an "n" in it, and second, when it does autocomplete ("zf create" for example) it won't let me backspace over my completed command. The first issue I'm completely stumped on. The second I'm thinking might have to do with escape characters from the colored text. Any ideas? It's driving me crazy!

    Read the article

  • zsh completion will not work in emacs shell

    - by benhsu
    I'm learning about the more powerful tab-completion and expansion capabilities of zsh, and they don't seem to work when I run zsh under emacs with M-x shell: cat $PATH<TAB> expands the tab variable in Terminal, but in shell-mode it just beeps. I poked around the emacs environment and here's what I found: TAB (translated from ) runs the command completion-at-point, which is an interactive compiled Lisp function in `minibuffer.el'. It is bound to TAB, . (completion-at-point) Perform completion on the text around point. The completion method is determined by `completion-at-point-functions'. completion-at-point-functions is a variable defined in `minibuffer.el'. Its value is (tags-completion-at-point-function) So I'm surmising I need to add a function to completion-at-point-functions, but which one?

    Read the article

  • Problem bash completion apt-get 12.10

    - by dadexix86
    I've got an annoying problem with completion and sudo apt-get. To give an example: $ sudo apt-get in[Tab][Tab] in intel_bios_reader includeres intel_disable_clock_gating indicator-multiload intel_dpio_read info intel_dpio_write infobrowser intel_error_decode infocmp intel_forcewaked infokey intel_gpu_abrt infotocap intel_gpu_time inimf intel_gpu_top init intel_gtt init-checkconf intel_l3_parity initctl intel_reg_checker initctl2dot intel_reg_dumper initex intel_reg_read inkscape intel_reg_snapshot inkview intel_reg_write inputattach intel_sprite_on insmod intel_stepping install intel_upload_blit_large install-docs intel_upload_blit_large_gtt installfont-tl intel_upload_blit_large_map install-info intel_upload_blit_small installkernel interdiff --More-- While is working right both with just apt-get or doing it in root: $ apt-get in[Tab]stall $ sudo -i [sudo] password for davide: root@brenna:~# apt-get in[Tab]stall So the problem is using autocompletion after sudo? Not really, because $ sudo apt-[Tab][Tab] apt-add-repository apt-extracttemplates apt-key apt-cache apt-file apt-mark apt-cdrom apt-ftparchive apt-sortpkgs apt-config apt-get Summing up, the problem seems to be using sudo and auto-completion for programs options together. Any good advice for that?

    Read the article

  • Unity Dash/Lens - Auto-completion based on recent search strings

    - by Anant
    Sometimes, I find myself typing the same (or quite similar) search strings inside a Unity Lens. So, I thought whether it's possible for the Lens to remember previous searches, and provide a drop-down menu of possible suggestions (based on the past) when I start typing my new query. With Lenses for sites like Wikipedia and DuckDuckGo, the search strings are getting longer, and this feature would lend a helping hand in filling out queries faster. This could be something applicable to all Lenses, with later versions allowing individual Lenses to run their own auto-completion algorithm.

    Read the article

  • Auto completion (using the Tab key) on the new Ubuntu 11.10

    - by Shubhroe
    Earlier, when I used tab to auto-complete filenames (using the tab key) and if the filenames contained blank spaces or certain special characters, the name would be listed with backslashes '\' thrown in so that it could work with a preceding command like ls or rm. eg. Earlier if I had a file name called "The Four Seasons- Spring - Allegro.mp3" and this was the only file name starting with "The", when I typed "rm The" and Tab, it would complete itself to "rm The\ Four\ Seasons-\ Spring\ -\ Allegro.mp3" and I could subsequently press Enter and remove the file. However, lately what happens when I press Tab is the following: "rm The Four Seasons- Spring - Allegro.mp3" and if I now press Enter, it returns a bunch of errors because it thinks I want to remove a bunch of files (named The, Four, etc.). Does anyone else encounter the same problems and if yes, is there a good way to resolve this problem? Thanks!

    Read the article

  • Menu tab completion for recent history in zsh

    - by dat5h
    I am interested in a potential zle widget for zsh. Is there a way to build a widget that mimics the kill-completion selectable menu? Essentially I want to be able to press , tab in vi-command-mode, or maybe !-tab-completion at the shell and get a list of recent history (or related history compared what is already entered at the commandline) that allows me to scroll through it and possibly select a relevant function to call or compare similar calls. Looking through the manual I stumbled onto a similar widget that I have mapped like so: # tab completion history menu (vicmd) autoload -z history-beginning-search-menu zle -N history-beginning-search-menu-space-end history-beginning-search-menu bindkey -M vicmd "\t" history-beginning-search-menu-space-end # emacs binding could be "\e\t"? (I wouldn't know) Therefore, if I enter vicmd and hit tab when I enter something like "grep", then I get a list of all grep calls in history. It also asks me for the list-number and it will perform the numbered item in history. If I enter a space and then try this, it lists ALL of my history history. This is fairly close to what I want, but there are some problems. For example, 1) it prints the entire list of relevant history and does not check the number of lines of the screen so it could easily blow up the space on the terminal; 2) when I type in numbers for selecting an item in history it does not show me the numbers I type, so I may make a mistake and have to start over again; 3) I would love to be able to hook in appearance tweaks. I was wondering if there exists more updated version of this widget or if there is any way to look at the source for kill-completion or history-beginning-search-menu to see if I could think of a way to do it.

    Read the article

  • bash completion with aliases

    - by dstarh
    I have a bunch of bash completion scripts set up (mostly using bash-it and some manually setup). I also have a bunch of aliases setup for common tasks like gco for git checkout. Right now I can type git checkout d tab and develop is completed for me but when I type gco d tab it does not complete. I'm assuming this is because the completion script is completing on git and it fails to see gco. Is there a way to generically/programmatically get all of my completion scripts to work with my aliases? Not being able to complete when using the alias kind of defeats the purpose of the alias.

    Read the article

  • Install Bash completion together with distutils / pip

    - by ifischer
    I have created a simple Python module and want to distribute it with pip. I also want to install a Bash completion file together with the module. I'm installing the module with Python 2.7.1+ and pip 0.8.2. I have this setup.py: setup( name='jenkinsmon', version='0.0.1', description='Jenkins Job Monitor', long_description=open('README.txt').read(), scripts=['bin/jenkinsmon'], data_files=[ ('/etc/bash_completion.d', ['extras/jenkinsmon.completion']), ], install_requires = [ 'autojenkins', 'argparse' ], ) Now if I try to install the package with pip install -e ., the Bash completion file never gets installed together with the package. I also tried workarounds by specifying a MANIFEST.in, like described here: MANIFEST.in: include extras/jenkinsmon.completion But this also doesn't help - the completion files won't get installed. What can I do to install the Bash completion files?

    Read the article

  • Getting more helpful tab completion prompts in bash?

    - by Rory McCann
    Let's say I have a directory with a few files in it like this: $ ls file1 file2 file3 And I want to do some tab completion in bash: $ cat file<tab> file1 file2 file3 I remember seeing someone doing tab completion and the shell bolded the next parts, so in this case, it would bold the 1, 2 and 3 of the filename so it'll look like this: file**1** file**2** file**3** which will tell you what you should type in next. I think this was a feature of zsh, but is there any way to get it in bash?

    Read the article

  • Tab-completion friendly names for start / stop

    - by Ben Page
    I have many scripts that are used to start and stop services. It is frustrating when using tab completion that you need to type: ./serviceScript.sh [sta|sto] before there is enough information for tab-completion to complete the word start or stop. Does anyone have a different pair of words that could be sensibly used in the place of start stop, or alternatively, a better solution to my problem?

    Read the article

  • Slow tab completion for paths in`make' arguments

    - by ajwood
    When I'm specifying an argument for make like PREFIX_PATH=/some/path/to/prefix/ I sometimes experience very slow completion for my directories (a few seconds). It's annoying when I've got several variables to specify. To get around the problem I've been typing out the variables first to get regular completion speed, then hitting home' to insertmake` that the start of my command line. What is happening and how can I fix it?

    Read the article

  • Tab Completion In Emacs shell-mode SSH Sessions

    - by Sean M
    My current use pattern of emacs results in my having several shell-mode buffers open, each running an ssh session. I am running into an issue with this, though - when I try to tab-complete file names and other things in my remote session, the shell attempts to use completions available on the local machine instead of on the remote machine. For example, if the file ~/foobar exists on the local machine and ~/frob exists on the remote machine, typing in ~/f and pressing tab results in ~/foobar instead of completing correctly. If I use ssh outside of emacs and try the same thing, I get the correct completion of ~/frob instead. How can I get tab-completion to complete the way it does in normal ssh sessions ?

    Read the article

  • Zsh, directory tab-completion with prefix

    - by nifty
    I have a directory where I put all my projects in, let's say it's ~/projects as an example. I've made a command called s which takes one argument, and moves me into that directory. E.g.: s foo moves me to ~/projects/foo. What I'd like is to have a completion command of some sorts, which would act like cd so I could do keep hitting tab to go further into the ~/projects/... directories. Basically, cd with a prefix which is always present. I've looked into zstyle completion in man zshcompsys, but realized I just don't know enough about it to understand it properly.

    Read the article

  • Recommended: git-completion.bash

    - by andy.grover
    If you use git on a daily basis like I do, git-completion.bash is a great way to make your life a little easier. While I guess it does add tab-completion for git commands, the most useful feature for me is the ability to put the current branch into the cmdline prompt. Now that I am comfortable working with multiple git branches and remotes, a little reminder where I am prevents time-consuming mistakes. git-completion.bash lives in git's git tree.git clone git://git.kernel.org/pub/scm/git/git.gitcopy git/contrib/completion/git-completion.bash to ~/.git-completion.shFollow the instructions in the file to set up, and enable showing branch in $PS1I also use this alias in my ~/.gitconfig, which is convenient:[alias]        log1 = log --pretty=oneline --abbrev-commitHave fun!

    Read the article

  • On Linux, why does directory tab completion add a \ to a path starting with ~

    - by crobar
    On my work scientific linux 6.2 machine, I often start typing in a directory like below and use tab completion to finish it: ~/mydir But when I hit tab, it becomes e.g. \~/mydirectory/ With an extra forward slash at the start. Why is this, and can I prevent it? It's a pain because using cd etc. doesn't work with the extra slash, I have to start from the actual home directory which is something like /home/username/ On these PCs.

    Read the article

  • zsh: Do NOT expand wildcard on tab completion

    - by BMorgenthaler
    I'm wondering how I can configure ZSH to NOT expand the wildcard in a filename. So for example I have a directory of a couple hundred files named like so: a.foo-bar a.foo b.foo-bar b.foo c.foo-bar c.foo I would like to be able to perform a tab completion matching AFTER a wildcard, so cat *.foo-< tab = cat *.foo-bar instead what I get is cat *.foo-< tab = cat a.foo-bar file a.foo-bar b.foo-bar c.foo-bar

    Read the article

  • Python editor with automatic code completion?

    - by netvope
    I have seen various articles about good Python editors/IDEs, like this. However, none of them points out whether the editors support automatic code completion. I tried notepad++, PyScript and Komodo Edit, but all of these requires a hotkey to invoke the code completion dialog. Do you know any Python editors with automatic code completion?

    Read the article

  • How to remove the file extension in a zsh completion?

    - by meeselet
    I want to adjust zsh so that I can tab complete: myprog <tab> using all *.foo files in ~/somedir, but have it so that it displays them without the .foo extension. Is there any way to do this? This is what I have so far: #compdef myprog typeset -A opt_args local context state line local -a mydirs mydirs="(. ~/somedir)" _arguments -s -S \ "*:name:->foos" \ && return 0 case $state in (foos) _files -W ${mydirs} -g '*.foo(:r)' && return 0 ;; esac return 1 However, this displays double the output for every file (that is, each .foo file is listed with and without its extension). Is there any way around this?

    Read the article

  • Bash completion doesn't work, or is ignoring what I've typed; but works for commands

    - by Neil Traft
    Bash completion seems to be ignoring what I've typed (it tries to complete, but acts as if there's nothing under the cursor). I know I saw it work on this machine earlier today, but I'm not sure what has changed. Some examples: cd shows all directories under my current folder: $ cd co<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ Commands like ls and less show all files and directories under my current folder: $ ls co<tab><tab> cmake/ config/ .cproject Doxyfile.in include/ programs/ README.txt src/ tests/ CMakeLists.txt COPYING.txt doc/ examples/ mainpage.dox .project sandbox/ .svn/ Even when I try to complete things from a different folder, it gives me only the results for my current folder (telling me that it is completely ignoring what I've typed): $ cd ~/D<tab><tab> cmake/ config/ doc/ examples/ include/ programs/ sandbox/ src/ .svn/ tests/ But it seems to be working fine for commands and variables: $ if<tab><tab> if ifconfig ifdown ifnames ifquery ifup $ echo $P<tab><tab> $PATH $PIPESTATUS $PPID $PS1 $PS2 $PS4 $PWD $PYTHONPATH I do have this bit in my .bashrc, and I have confirmed that my .bashrc is indeed getting sourced: if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi I've even tried manually executing that file, but it doesn't fix the problem: $ . /etc/bash_completion There was even one point in time where it was working for ls, but was not working for cd ... but I can't replicate that result now. Update: I also just discovered that I have terminals open from earlier that still work. I ran source .bashrc in one of them and afterwards completion was broken. Here is my .bashrc: # ~/.bashrc: executed by bash(1) for non-login shells. # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) # for examples # # Modified by Neil Traft #source ~/.profile # Allow globs to expand hidden files shopt -s dotglob nullglob # If not running interactively, don't do anything [ -z "$PS1" ] && return # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth # append to the history file, don't overwrite it shopt -s histappend # for setting history length see HISTSIZE and HISTFILESIZE in bash(1) HISTSIZE=1000 HISTFILESIZE=2000 # check the window size after each command and, if necessary, # update the values of LINES and COLUMNS. shopt -s checkwinsize # If set, the pattern "**" used in a pathname expansion context will # match all files and zero or more directories and subdirectories. #shopt -s globstar # make less more friendly for non-text input files, see lesspipe(1) [ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" # set variable identifying the chroot you work in (used in the prompt below) if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi # Color the prompt export PS1="\[$(tput setaf 2)\]\u@\h:\[$(tput setaf 5)\]\W\[$(tput setaf 2)\] $\[$(tput sgr0)\] " # enable color support of ls and also add handy aliases if [ -x /usr/bin/dircolors ]; then test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" alias ls='ls --color=auto' #alias dir='dir --color=auto' #alias vdir='vdir --color=auto' alias grep='grep --color=auto' alias fgrep='fgrep --color=auto' alias egrep='egrep --color=auto' fi # Add an "alert" alias for long running commands. Use like so: # sleep 10; alert alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' # Alias definitions. # You may want to put all your additions into a separate file like # ~/.bash_aliases, instead of adding them here directly. # See /usr/share/doc/bash-doc/examples in the bash-doc package. if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi # enable programmable completion features (you don't need to enable # this, if it's already enabled in /etc/bash.bashrc and /etc/profile # sources /etc/bash.bashrc). if [ -f /etc/bash_completion ] && ! shopt -oq posix; then . /etc/bash_completion fi

    Read the article

  • Unix file naming convention for effective tab completion?

    - by thebossman
    I feel like I often name files in such a way that my computer constantly beeps while I program because the tab completion is ambiguous. Before doing a lot of Unix programming, I tended to name related files with the same prefix to indicate their relation. Now I must re-think my approach to folder and file structures and names to program more effectively. What heuristics or rules do you apply when programming to simplify tab completion? Do you use any tools to make tab completion smoother (e.g., emacs icicles)?

    Read the article

  • NetBeans parameter fill after code completion

    - by byte
    This is a particularly annoying problem I'm having, and I can't be the only one to have issue with it. In NetBeans, when you type part of a method, then hit CTRL-SPACE, it displays the code-completion popup, whereupon you can hit tab to finish out the word. This is great, and pretty much how all IDE's operate. Example: Thread.sl < CTRL-SPACE Thread.sleep Yay! Problem is that in this context, once you type in a paren, it auto-fills the parameters for the method with their default names, and inserts a closing paren (regardless of whether you have disabled the option to automatically close them on the preferences page for code completion). This behavior is NOT present if you had manually typed out the full name. How is this helpful to anyone? You've got to type over it your actual variable that you will be passing, and NetBeans gives you no option to prevent the closing paren on code-completion. Does anyone have a way to solve this issue, without having to dive into the netbeans source and build it just for this minor of an issue?

    Read the article

  • How do I restore tab-completion on shell variables on the bash command-line?

    - by Eric
    I've long set my most-recently visited directories to shell variables d1, d2, etc. On an ancient Fedora machine I could type a command like $ cp $d1/ and the shell would replace $d1 with text like /home/acctname/projects/blog/ and would then show me the contents of .../blog, like any tab-completion. Now, both ubuntu wheezy/sid and fedora 16 just -escape the '$', and naturally there are no completions to show. You can see this behavior in action in an OSX Terminal window. On 10.8, do something like ls $HOME/ to see what I mean. Is there a bash shell variable or option that can restore the old behavior? man bash suggests this is a bug: complete (TAB) Attempt to perform completion on the text before point. Bash attempts completion treating the text as a variable (if the text begins with $), username (if the text begins with ~), hostname (if the text begins with @), or command (including aliases and functions) in turn. If none of these produces a match, filename completion is attempted. I get the above described completion when a token starts with '~' or a letter. It's just '$'-completion that's broken.

    Read the article

  • Is there an IDE that provides code completion for Python

    - by Justin Walgran
    I am quite fond of the Intellisense code completion baked into Microsoft Visual Studio. I find that I only type 2 to 4 characters of any given keyword which drasticaly speeds up my coding. Now that I have been spending time writing some Python code I find myself reaching for ctrl+space. Are there any IDEs that support code completion in Python? I do my python development on a Mac so an OS x tool would be preferable. It seems like the doc string property of Python methods is a perfect match for inline API discovery.

    Read the article

  • Webcast: Flow Manufacturing Work Order-less Completion

    - by ChristineS-Oracle
    Webcast: Flow Manufacturing Work Order-less Completion Date: August 27, 2014 at 11:00 am ET, 10:00 am CT, 9:00 am MT, 8:00 am PT, 8:30 pm, India Time (Mumbai, GMT+05:30) This advisor webcast is intended for technical and functional users who want to understand the Flow Manufacturing Work Order-less Completion and its Transaction types. This presentation will include the required setups and provide details of the business process. Topics will include: Overview of Flow Manufacturing and Integration with Work In Process Overview of Work Order-less Completion Basic Setup Steps Transactions performed in Work Order-less Completion form Details & Registration: Doc ID 1906749.1

    Read the article

1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >