SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
i'm used to using vi in other distros. how do i use the backspace or delete key when using vi in slackware 9.1? when i press them nothing happens at all. is there a better CLI editor i should be using?
Click here to see the post LQ members have rated as the most helpful post in this thread.
You might try using the text editor 'joe'.
I use vi all the time as it's fast and present in all distros in some form or another. In Slackware it is actually 'elvis' in others maybe something else which is wha they don' always act the same. Something I only found out recently is that vi will render html files as well!
'x' deletes characters under the cursor and to the right of the cursor(one at a time)
Personally I link vim rather than elvis to vi. As root:
rm /usr/bin/vi
ln -s /usr/bin/vim /usr/bin/vi
Then as your regular user make a file called .vimrc in your home directory, with these contents:
set backspace=indent,eol,start
fixdel
And you can now use backspace when you run vi (which is now really vim).
In my .vimrc I also have:
syntax enable
set number
set autoindent
set tabstop=4
which enables syntax highlighting, shows line numbers, autoindents your code and sets the tab length to 4 characters. There are tons of other options, have a look on the vim website.
There is also an integrated tutorial in vim, it takes about 30 mins and is well worth it to introduce you to some of vim's less than intuitive features... it's a great editor once you get the hang of it.
Yes vim is also nice. Maybe it was 'jed' I meant to suggest instead of joe. I haven't used them, just know that thex are there in Slack 9.1. One other trick, though for vi- it can be called from within 'less'. This is nice for viewing and then editing files, since if you make a typo in vi, a file will be created with the name you typed. So instead of directly calling a file in vi: vi /etc/X11/XF86Config, I call it with 'less':
less /etc/X11/XF86Config then when i find the section I want to edit just type 'vi' (within less). After exiting vi witn ':q!' or ':wq' it returns you to 'less'. a much safer way to quickly edit files. You have posted are probably familiar with these tricks, but I post them for the benefit of others who may not know.
Originally posted by Mugatu i'm used to using vi in other distros. how do i use the backspace or delete key when using vi in slackware 9.1? when i press them nothing happens at all. is there a better CLI editor i should be using?
backspace or delete are not standard vi commands.
* ctrl+x deletes char
* d$ deletes rest of the line
* dG deletes rest of the file
* dd deletes line and puts the line in the clipboard
* 5dd deletes line + 4 next lines
I think the most userfriendly of the console based text editors is pico or nano. Just be sure to use pico -w on the config files. I use both it and elvis for all my text editing needs
I grabbed a very very nice .vimrc file from somewhere and I can't remember the site or I would post it. It seems to be a problem with terminal emulation as to the backspace problem... for instance.... in console you can backspace fine, however in say Gnome-terminal it doesn't work so well where as in rxvt it works fine. Not sure how to correct this though, and I havn't had much time, but theres my $0.02
Originally posted by Kovacs Personally I link vim rather than elvis to vi. As root:
rm /usr/bin/vi
ln -s /usr/bin/vim /usr/bin/vi
Then as your regular user make a file called .vimrc in your home directory, with these contents:
set backspace=indent,eol,start
fixdel
And you can now use backspace when you run vi (which is now really vim).
In my .vimrc I also have:
syntax enable
set number
set autoindent
set tabstop=4
which enables syntax highlighting, shows line numbers, autoindents your code and sets the tab length to 4 characters. There are tons of other options, have a look on the vim website.
There is also an integrated tutorial in vim, it takes about 30 mins and is well worth it to introduce you to some of vim's less than intuitive features... it's a great editor once you get the hang of it.
After hours of frustration, that worked!!! You're a genius, thanks man!!!
Actually your solution worked but then I had to start from scratch, when I created the .vimrc file, now the "delete" key does not work. Could you explain the reason why?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.