I am curious Adrian, aren't you using something like qtcreator when developing the qt-based MX tools ? I'd have thought auto-completion can come real handy when working with rich class libraries.Adrian wrote: Mon Jul 13, 2020 10:04 amI started to use vim exclusively because once you learn it it makes editing much more efficient
vim.tiny [Solved]
Re: vim.tiny
Re: vim.tiny
qtcreator is amazing, but I use vim for editing config files and the like. BTW, qtcreator has a fakevim mode where you could use vim kind of controls to edit, I was not brave enough to enable that.baldyeti wrote: Tue Jul 14, 2020 4:50 amI am curious Adrian, aren't you using something like qtcreator when developing the qt-based MX tools ? I'd have thought auto-completion can come real handy when working with rich class libraries.Adrian wrote: Mon Jul 13, 2020 10:04 amI started to use vim exclusively because once you learn it it makes editing much more efficient
Re: vim.tiny
Ah, good to know. So do KDE's kate and eclipse (vrapper plugin, very nice, also works with pydev or dbeaver).Adrian wrote: Tue Jul 14, 2020 9:56 am qtcreator has a fakevim mode where you could use vim kind of controls to edit, I was not brave enough to enable that.
Re: vim.tiny
Hey Brothers
I also am a fan of vim. I am just learning. In the words of the Shaman, I can use visual. Amazingly, once you start to get the hang of vim, gui based editors are just annoying. I found learning vim a lot like learning to cook a meal. At first, you think that you will never be able to keep track of everything that is going on, but very quickly, you can't even remember why you were confused.
My more immediate concern is that I need to configure vim on MX. I have not yet written a .vimrc, and I would appreciate any tips that are offered.
BTW, I upgraded vim "$ sudo apt-get upgrade vim", it gave me vim HUGE.
Thank you.
I also am a fan of vim. I am just learning. In the words of the Shaman, I can use visual. Amazingly, once you start to get the hang of vim, gui based editors are just annoying. I found learning vim a lot like learning to cook a meal. At first, you think that you will never be able to keep track of everything that is going on, but very quickly, you can't even remember why you were confused.
My more immediate concern is that I need to configure vim on MX. I have not yet written a .vimrc, and I would appreciate any tips that are offered.
BTW, I upgraded vim "$ sudo apt-get upgrade vim", it gave me vim HUGE.
Thank you.
Re: vim.tiny
That's usually personal preference, for example if you want line numbers you can add:My more immediate concern is that I need to configure vim on MX. I have not yet written a .vimrc, and I would appreciate any tips that are offered.
Code: Select all
set number
If you want syntax highlighting:
Code: Select all
set syntax
Code: Select all
" insert and remove comments
augroup commentshortcut
let b:comment_leader = '# '
autocmd FileType c,cpp,java,scala let b:comment_leader = '// '
autocmd FileType sh,ruby,python,perl let b:comment_leader = '# '
autocmd FileType conf,fstab let b:comment_leader = '# '
autocmd FileType tex let b:comment_leader = '% '
autocmd FileType mail let b:comment_leader = '> '
autocmd FileType vim let b:comment_leader = '" '
noremap <silent> <Leader>cc :<C-B>silent <C-E>s/^\(\s*\)/\1<C-R>=escape(b:comment_leader,'\/')<CR>/<CR>:nohlsearch<CR>
noremap <silent> <Leader>xx :<C-B>silent <C-E>s/^\(\s*\)\V<C-R>=escape(b:comment_leader,'\/')<CR>/\1/e<CR>:nohlsearch<CR>
augroup END
Re: vim.tiny
Totally stolen from others, and added to over many years, here is my .vimrc. Use freely, but at own risk. It's only 104 lines, including comments and blank lines to make it more readable.
Code: Select all
" An example for a vimrc file.
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2002 Sep 19
"
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
" for OpenVMS: sys$login:.vimrc
" When started as "evim", evim.vim will already have done these settings.
if v:progname =~? "evim"
finish
endif
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" allow backspacing over everything in insert mode
set backspace=indent,eol,start
if has("vms")
set nobackup " do not keep a backup file, use versions instead
else
set backup " keep a backup file
endif
set history=50 " keep 50 lines of command line history
set ruler " show the cursor position all the time
set showcmd " display incomplete commands
set incsearch " do incremental searching
" For Win32 GUI: remove 't' flag from 'guioptions': no tearoff menu entries
" let &guioptions = substitute(&guioptions, "t", "", "g")
" Don't use Ex mode, use Q for formatting
map Q gq
" This is an alternative that also works in block mode, but the deleted
" text is lost and it only works for putting the current register.
"vnoremap p "_dp
" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
syntax on
set hlsearch
endif
highlight Comment ctermfg=DarkGray
hi LineNR ctermfg=DarkGray
" hi CursorLineNR ctermfg=Red
" hi String ctermfg=Gray
" hi PreProc ctermfg=Brown
" Only do this part when compiled with support for autocommands.
if has("autocmd")
" Enable file type detection.
" Use the default filetype settings, so that mail gets 'tw' set to 72,
" 'cindent' is on in C files, etc.
" Also load indent files, to automatically do language-dependent indenting.
filetype plugin indent off
" Put these in an autocmd group, so that we can delete them easily.
augroup vimrcEx
au!
" For all text files set 'textwidth' to 78 characters.
autocmd FileType text setlocal textwidth=78
" When editing a file, always jump to the last known cursor position.
" Don't do it when the position is invalid or when inside an event handler
" (happens when dropping a file on gvim).
autocmd BufReadPost *
\ if line("'\"") > 0 && line("'\"") <= line("$") |
\ exe "normal g`\"" |
\ endif
augroup END
else
set noautoindent " always set autoindenting on
endif " has("autocmd")
"set wrap
"set linebreak
"set nolist
"set wrapmargin=80
"set number
set spellfile=~/.vim/spellfile.add
set spelllang=en_us
map <F2> :set nospell
map <F3> :set spell
set t_BE= " correct bracketed mode paste
set cm=blowfish2