Search Results

Search found 39 results on 2 pages for 'yank'.

Page 1/2 | 1 2  | Next Page >

  • Is there any way to do an emacs-like yank in vim?

    - by Jason Baker
    In emacs, yanking works something like this: if you delete something, it can be yanked back into another position. In other words, emacs's yank is sort of like cut and paste. On the other hand, it seems like vim's yank is like copy and paste: I can yank something and then paste it elsewhere, but the original text is still there. Is there any way to cut the text rather than just copying it in vim?

    Read the article

  • Yank file name / path of current buffer in Vim

    - by Dave Tapley
    Assuming the current buffer is a file open for edit, so :e does not display E32: No file name. I would like to yank one or all of: The file name exactly as show on the status line, e.g. ~\myfile.txt A full path to the file, e.g. c:\foo\bar\myfile.txt Just the file name, e.g. myfile.txt

    Read the article

  • Vim: yank and replace -- the same yanked input -- multiple times, and two other questions

    - by Hassan Syed
    Now that I am using vim for everything I type, rather then just for configuring servers, I wan't to sort out the following trivialities. I tried to formulate Google search queries but the results didn't address my questions :D. Question one: How do I yank and replace multiple times ? Once I have something in the yank history (if that is what its called) and then highlight and use the 'p' char in command mode the replaced text is put at the front of the yank history; therefore subsequent replace operations do not use the the text I intended. I imagine this to be a usefull feature under certain circumstances but I do not have a need for it in my workflow. Question two: How do I type text without causing the line to ripple forward ? I use hard-tab stops to allign my code in a certain way -- e.g., FunctionNameX ( lala * land ); FunctionNameProto ( ); When I figure out what needs to go into the second function, how do I insert it without move the text up ? Question three Is there a way of having a uniform yank history across gvim instances on the same machine ? I have 1 monitors. Just wondering, atm I am using highlight + mouse middle click.

    Read the article

  • tmux combine multiple commands to one vi-copy command or tmux command to yank a line

    - by MIkhail
    In tmux, i know we can chain multiple commands to a key by using \; See Here But in vi mode, i want one single key press to go to the beginning of the current line, begin-selection, go to end-of-line, copy-selection. In tmux.conf if i give the following bind-key -t vi-copy 's' start-of-line \; begin-selection \; end-of-line \; copy-selection \; It gives me this : 69: usage: bind-key [-cnr] [-t key-table] key command [arguments] error. Or is there any alternative way to yank the current line in single key.

    Read the article

  • How to replace a region in emacs with yank buffer contents?

    - by Mad Wombat
    When I use VIM or most modeless editors (Eclipse, NetBeans etc.) I frequently do the following. If I have similar text blocks and I need to change them all, I will change one, copy it (or use non-deleting yank), select next block I need and paste the changed version over it. If I do the same thing in emacs (select region and paste with C-y), it doesn't replace the region, it just pastes at the cursor position. What is the way to do this in emacs?

    Read the article

  • Is it safe to just yank an external hard drive if you know nothing is writing to it?

    - by Nathaniel
    Yes, I know somewhat about the possibility of data corruption if there was data that hadn't been all written to it. But I just saw this: Note:If u remove HDD(not USB sticks) without safely removing it,its not healthy and will affect life. So, if nothing is actually writing to it, could there actually be any harm caused by not safely removing or unmounting it before disconnecting it?

    Read the article

  • Emacs 24.1: How do I restore i-search Ctrl-Y behavior from older versions?

    - by Eric
    In emacs 24.1, when you do Ctrl-Y in an interactive search, it yanks the kill buffer into the search string ("it pastes the clipboard contents" in any-other-app's language) and tries to match it. In the last 20 versions or so, pressing Ctrl-Y matches the rest of the current line. I have two very common use cases: Match this line, revert the buffer, and search for the line (less often:) Where else is this text in the buffer? I tried modifying /lisp/isearch.el, switching the bindings for isearch-yank-line (which I want) and isearch-yank-kill (which I'm fine binding to the ridiculous \M-s\C-e key sequence). But I don't think this file even gets picked up. But I don't think this file even gets loaded. If I explicitly load it, I still get the 24.1 behavior. Here's my change: (add-hook 'isearch-mode-hook (lambda () (define-key isearch-mode-map "\C-y" 'isearch-yank-line) (define-key isearch-mode-map "\M-s\C-e" 'isearch-yank-kill) )) No change in the behavior. I even tried hacking isearch.el, still no change. This is on Windows btw, but I suspect it doesn't matter. Could someone tell me how I can restore the old binding?

    Read the article

  • why is my emacs yanking the wrong text?

    - by Josh Knox
    running emacs 22... on ubuntu 9.04, fresh install. When I copy a region of text via C-w (clipboard-kill-ring-save) then yank it back with C-y (clipboard-yank) it pastes random stuff, from some other buffer that isn't even open. It was working fine earlier today and I haven't changed my emacs config. Any ideas why this is suddenly happening/ how to fix it? Thanks!

    Read the article

  • Is there a way to copy/paste with iterm2 on osx over ssh with tmux and vim?

    - by Aaron Gibralter
    Given I am SSHed into a server and have tmux running, is there any straightforward way to be able to yank into a register in vim and: have that text be available in my tmux clipboard? have that text available in my osx clipboard? I know how to copy/paste in tmux and iterm2 seems to handle passing that onto my osx clipboard. However there are times when I want to yank text in a vim split screen and the tmux copy/paste won't do. Anyone figured this out? Thanks so much!

    Read the article

  • In Vim, what is the best way to select, delete, or comment out large portions of multi-screen text?

    - by Edward Tanguay
    Selecting a large amount of text that extends over many screens in an IDE like Eclipse is fairly easy since you can use the mouse, but what is the best way to e.g. select and delete multiscreen blocks of text or write e.g. three large methods out to another file and then delete them for testing purposes in Vim when using it via putty/ssh where you cannot use the mouse? I can easily yank-to-the-end-of-line or yank-to-the-end-of-code-block but if the text extends over many screens, or has lots of blank lines in it, I feel like my hands are tied in Vim. Any solutions? And a related question: is there a way to somehow select 40 lines, and then comment them all out (with "#" or "//"), as is common in most IDEs?

    Read the article

  • Vim: How to handle newlines when storing multiple commands in registers?

    - by UncleZeiv
    I have a file where I store snippets of vim commands. When I need a snippet, I yank it and then execute it with @". The snippets are stored as a script, one line per command, like this: :s/foo/bar/g :echo "hello" :s/1/2/g Edit: I removed normal mode commands from the example, as they were not part of the problem. Now this procedure doesn't work anymore: when executing the snippet, it just stops at the first line as if waiting for a newline. Is there an option somewhere affecting how @ is executed? I'm pretty sure it was working some time ago... Substituting the newline with a ^M character works but makes the file more difficult to handle. Additional information: Here's another symptom: when I yank a snippet, if I execute it with @" it stops at the first line as I just explained. But if I execute it with :@ it works. But the help file doesn't seem to imply any difference in how the two commands treat the register's content...

    Read the article

  • Good PHP books for starters, any recommendations?

    - by Goma
    I started reading some PHP books. Most of them in their introduction say that this book , unlike other books, it follows a good habits and practices. Now, I do not know which book tells the truth, and which writer is the most experienced in PHP. These are the books that I had a quick look to their first chapter: PHP and MySQL Web Development (Developer's Library) by Luke Welling and Laura Thomson. Build Your Own Database Driven Web Site Using PHP & MySQL by Kevin Yank. PHP and MySQL for Dummies by Janet Valade. Now, it's your time to advise me and tell me about the excellent one that follows best practices, please give an advice from your experience. (It could be any other book!). Regards,

    Read the article

  • Good PHP BOOKS for starters!

    - by Goma
    I started reading some PHP books. Most of them in their introduction say that this book , unlike other books, it follows a good habits and practices. Now, I do not know which book tells the truth, and which writer is the most experienced in PHP. These are the books that I had a quick look to their first chapter: PHP and MySQL Web Development (Developer's Library) by Luke Welling and Laura Thomson. Build Your Own Database Driven Web Site Using PHP & MySQL by Kevin Yank. PHP and MySQL for Dummies by Janet Valade. Now, it's your time to advise me and tell me about the excellent one that follows best practices, please give an advice from your experience. (It could be any other book!). Regards,

    Read the article

  • Is there an analog for the VI '.' command to repeat-last-typed-text

    - by Don
    I've used emacs for decades and always wondered, but kept on coding, if there was a way to type in something, them move the cursor and insert the same text, like the VI . command. Instead what I do is to type the text, set the mark, backup, copy the region, go to the next spot (often just C-n, down one line) and then pre-arg yank, C-u C-y. It's the overhead of set mark, backup and copy region that makes me just go ahead and retype the thing.

    Read the article

  • Is there an Emacs-analog for the VI '.' command to repeat-last-typed-text

    - by Don
    I've used emacs for decades and always wondered, but kept on coding, if there was a way to type in something, them move the cursor and insert the same text, like the VI . command. Instead what I do is to type the text, set the mark, backup, copy the region, go to the next spot (often just C-n, down one line) and then pre-arg yank, C-u C-y. It's the overhead of set mark, backup and copy region that makes me just go ahead and retype the thing.

    Read the article

  • gVIM "put" driving me mad, how do I "put" at the beginning of a line

    - by crgnz
    I'm learning gVIM on Windows, and as I slowly learn more of the keystrokes I find myself using the mouse less and less, which is great. I have a couple of questions I've yet to figure out: I do a lot of copy and paste. So I use 'v' to enter VISUAL mode, use k/j to move up/down and select the lines, then hit 'y' to yank. I then go to the line where I want to insert, and hit 'p' to put, BUT the darn thing pastes after the 1st character. I can't move any further left, so I am definitely at the start of the line, so I find the 'p'ut behaviour of pasting 1 char after my cursor position to be supremely annoying. I switch between edit and command mode an awful lot, and my poor little finger on my left hand is getting sore from being stretched out to hit the 'Esc' key (to enter command mode) every few seconds. Is there a more finger-friendly way to enter command mode?

    Read the article

  • Wireless Keyboard Intermittent Failure to Type and Added Characters

    - by Kashif
    My keyboard has been acting up from time to time. It's wireless so this may be a wireless issue. What happens is I will be typing and then all of a sudden it seems to stop responding. If I type out this sentence it may show up like so If I ttennnnnnnnn it may ssssssp so While typing that sentence I may have to mash on a key repeatedly to get it to type. The resulting strings of letters seem to be coming as if the keyboard buffer cannot keep up. It's so weird. If I take the USB tranceiver and yank it out then plug it back in, Voila! Problem solved. I did the battery check so that's not a problem. Any suggestions? My keyboard is the Logitech MX3200

    Read the article

  • vimperator copy/pasting

    - by hasen j
    I'm trying out vimperator, I mainly wanted it for the hjkl scrolling, I like it's "hint" system for following links, these two features are really all I need; I think. I don't mind the other features, it just sometimes get in my way. The thing that annoys me the most is copy/pasting. I'm used to ctrl-c/ctrl-v, I don't mind using another shortcut, but .. :help yank indicates that copying selected text is done with Y, but the only method mentioned for pasting is the middle mouse button! This is so ridiculously against the spirit of vim! How can I paste in vimperator without using the mouse?

    Read the article

  • How to kill volume when headphones pulled out

    - by wonea
    I often use headphones in order to listen to music in work time. However my chair tends to occasionally have the tendency to yank the headphone cable from my laptop. Now with my Android phone this wouldn't be a problem as the music will automatically stop playing. However, Windows does not kill the volume and instead re-routes the sound to my laptop internal speaker system. Aside from turning off my laptop speakers - is there a small utility available which serves my purpose of killing the volume so my work associates aren't inflicted with erroneous musical tastes?

    Read the article

  • What happens with the Guest OS's on ESXi in the event of a power failure?

    - by Jeremy Holovacs
    Many small businesses would prefer to let their server drop on power failure than to pay even $100 for a cheap UPS. It's often difficult to convince them of the value of something like that; it's why they like ESXi. It's free, they can save a lot of cash by putting a bunch of linux servers on one machine, and then I get paid. :) If the ESXi server experiences a power outage, it is set to come back on automatically when power is restored. What happens with the guest OS's? Ideally I would like them to all come online again as well, assuming they were on when power was lost, but I see no option for choosing this. I don't want to yank power to the system just to try it out, of course. I'm sure someone knows what happens by default, and perhaps how to make my system to work as I would wish.

    Read the article

  • Can I copy from vim to another window without +xterm-clipboard?

    - by GorillaSandwich
    I'm using Ubuntu and vim. I can copy text from vim and paste it into another window by highlighting it in vim, then middle-clicking in the other window. This works fine when I'm on my local machine. I can also copy into the system register by highlighting text and yanking to the system register. (For example, Shift-V JJ "+ y to go into linewise visual mode, highlight two lines, select the '+' register and yank.) It's then available to paste into other windows. However, if I ssh into my web host, I can't do either of these. (They use some flavor of Linux - I think it's CentOS.) In vim, if I type :version, my local version shows +xterm_clipboard, but the host's version shows -xterm_clipboard. I don't have sudo rights there. Is there any way to be able to copy from their vim without getting them to tinker with the installation?

    Read the article

  • How do I cut and paste between different files using emacs?

    - by JStarx
    I'm running OSX 10.6.8. Lets say I have two terminal windows open and in each window I begin editing a different file using emacs. In the first file I select some text and then copy it (M-w), and in the second file I then try and paste it (C-y). I thought this would paste what I copied from the other file but instead I get the error message "previous command was not a yank". Those commands work just fine for copying and pasting within a single file, how do I copy and paste between different files?

    Read the article

  • Pub banter - content strategy at the ballot box?

    - by Roger Hart
    Last night, I was challenged to explain (and defend) content strategy. Three sheets to the wind after a pub quiz, this is no simple task, but I hope I acquitted myself passably. I say "hope" because there was a really interesting question I couldn't answer to my own satisfaction. I wonder if any of you folks out there in the ethereal internet hive-mind can help me out? A friend - a rather concrete thinker who mathematically models complex biological systems for a living - pointed out that my examples were largely routed in business-to-business web sales and support. He challenged me with: Say you've got a political website, so your goal is to have somebody read it and vote for you - how do you measure the effectiveness of that content? Well, you would. umm. Oh dear. I guess what we're talking about here, to yank it back to my present comfort zone, is a sales process where your point of conversion is off the site. The political example is perhaps a little below the belt, since what you can and can't do, and what data you can and can't collect is so restricted. You can't throw up a "How did you hear about this election?" questionnaire in the polling booth. Exit polls don't pull in your browsing history and site session information. Not everyone fatuously tweets and geo-tags each moment of their lives. Oh, and folks lie. The business example might be easier to attack. You could have, say, a site for a farm shop that only did over the counter sales. Either way, it's tricky. I fell back on some of the work I've done usability testing and benchmarking documentation, and suggested similar, quick and dirty, small sample qualitative UX trials. I'm not wholly sure that was right. Any thoughts? How might we measure and curate for this kind of discontinuous conversion?

    Read the article

  • Overriding a function in Emacs Lisp

    - by scrapdog
    I would like to temporarily override the kill-new function. I have a way I want to reimplement kill-new that works in only in certain contexts, but I don't want to reimplement a special version of kill-region on top of that. (kill-new is called from kill-region) Since Emacs Lisp uses dynamic scoping, this should be possible, right? (On the other hand, it seems that this would be an unsafe thing to support, and it might make me a bit nervous knowing that it is possible...) I have experimented with using let and fset, but so far have found no way to get it to work as expected. So, hopefully someone can fill in the blank in the following pseudocode: (defun my-kill-new (string &optional replace yank-handler) (message "in my-kill-new!")) (defun foo () (some-form-that-binds-a-function (kill-new my-kill-new) (kill-region (point) (mark)))) What should some-form-that-binds-a-function be? Or am I barking up the wrong tree?

    Read the article

  • gvim: Easy copying into system clipboard

    - by Georg Jaehnig
    I am using gVim on Ubuntu 10.10. I want to copy (yank) text to the system clipboard, so that the copied text is available in other applications. This works with "+y. But I want to have it working with y. I have tried to map y to "+y but then yy doesn't work anymore (since it produces "+y"+y). I have also tried :set clipboard=unnamed but this works only the other direction: Text in the system clipboard I can paste with p.

    Read the article

1 2  | Next Page >