Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 07-10-2012
Registered User
 
Join Date: Jun 2008
Location: Columbia, SC
Posts: 63
Thanks: 19
Thanked 17 Times in 17 Posts
AIX - VI/VIM Newbie Keymapping Help.

When I use the PgUp/PgDn keys it does strange things, like make the next letters change case. I know that it's because what the key is sending is telling vi to move to the next letter and change the case, but I'm absolutely having no luck in remapping PgUp/PgDn (CTRL+B/F) to those keys.

CTRL+V on the two gives me:
PgUp - ^[[5~
PgDn - ^[[6~

I'm not very affluent in VIM configuration, but I simply cannot get this remap to fucntion. In case it's needed, my .vimrc is below:


Code:
" ==== settings ====
syn on                          " Turn on syntax highlighting
set nocompatible                " Allow for a lot more options
set expandtab                   " When you hit tab actually use spaces
set history=50                  " keep 50 lines of command line history
set hlsearch                    " Switch on highlighting of the last used search pattern
set ignorecase                  " On searches
set smartcase                   " Works with ignorecase
set laststatus=2                " Make sure the status line is always displayed
set nobackup                    " Do not create backups
set nocompatible                " Better for Vim features
set nu                          " turn on line numbers
set ruler                       " Display ruler
set shell=/bin/ksh              " Set default shell
set showcmd                     " Show commands
set showmatch                   " Shiow matching brackets
set showmode                    " Display what mode you are in
set smartindent                 " Turn on file typed indenting
set tabstop=4                   " Number of spaces when converting tabs
set shiftwidth=4                " Characters added for indentation
set viminfo='1000,f1,<500       " File information to Keep
set backspace=indent,eol,start  " Expected backspace behavior
set pastetoggle=<F2>            " Allows for proper pasting when indents would occur.
set background=dark             " This is set for white on black
retab                           " When you open a file, convert all the tab characters into spaces.

" ==== Folding ====
" Disable folding by default, we'll enable it with a hotkey
function ForceFoldmethodIndent()
    if &foldenable
        se foldmethod=indent
    endif
endfunction
nnoremap <F9> zi|call ForceFoldmethodIndent()
inoremap <F9> zi|call ForceFoldmethodIndent()
set nofoldenable                " Disable folding by default, we'll enable it with a hotkey

" ==== File based settings ====
filetype plugin on
filetype indent on
if has("autocmd")
    " Restore cursor position
    au BufReadPost * if line("'\"") > 0|if line("'\"") <= line("$")|exe("norm '\"")|else|exe "norm $"|endif|endif

    " Filetypes (au = autocmd)
    au FileType helpfile set nonumber      " no line numbers when viewing help
    au FileType helpfile nnoremap <buffer><cr> <c-]>   " Enter selects subject
    au FileType helpfile nnoremap <buffer><bs> <c-T>   " Backspace to go back
    " Rexx
    au BufRead,BufNewFile *.zrx  setfiletype rexx
    au BufRead,BufNewFile *.rx  setfiletype rexx
    au BufRead,BufNewFile *.rexx  setfiletype rexx
    " C types - Set coding indents
    au FileType cpp,c,java,sh,pl,php,asp  set autoindent
    au FileType cpp,c,java,sh,pl,php,asp  set smartindent
    au FileType cpp,c,java,sh,pl,php,asp  set cindent
    " Text files
    au BufRead,BufNewFile *.txt  setfiletype txt
    au BufRead,BufNewFile *.log  setfiletype txt
    au BufRead,BufNewFile *.vcf  setfiletype txt
    " Automatically chmod +x Shell and Perl scripts
    "au BufWritePost   *.sh             !chmod +x %
    "au BufWritePost   *.pl             !chmod +x %
    " File formats
    " Misc types
    au BufNewFile,BufRead  *.pls    set syntax=dosini
    au BufNewFile,BufRead  modprobe.conf    set syntax=modconf
    au BufNewFile,BufRead  *.d    set syntax=dtrace
    " Shell scripts
endif

" ==== HUD ====
set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [ASCII=\%03.3b]\ [POS=%04l,%04v][%p%%]\ [LEN=%L]
set listchars=tab:\|\ ,trail:�,eol:<

" ==== Version 7 related ====
if version >= 700 
    "set spell                    " turn on spell check
  au InsertEnter * hi StatusLine term=reverse ctermbg=5 gui=undercurl guisp=Magenta 
  au InsertLeave * hi StatusLine term=reverse ctermfg=0 ctermbg=2 gui=bold,reverse 
endif

" DOS to Unix conversion (remove ^M)
" added mark (m) so we end up where we started
noremap <Leader>D mmHmt:%s/<C-V><CR>//ge<CR>'tzt'm

" Fixes color on AIX 5.3
if has("terminfo")
    let &t_Co=8
    let &t_Sf="\e[3%p1%dm"
    let &t_Sb="\e[4%p1%dm"
else
    let &t_Co=8
    let &t_Sf="\e[3%dm"
    let &t_Sb="\e[4%dm"
endif

" Fix for delete when it doesn't work right on AIX...
map! ^[[3~ <BS>

Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
perl newbie . &&..programming newbie xytiz Shell Programming and Scripting 13 06-03-2009 01:29 PM
perl newbie . &&..programming newbie (question 2) xytiz Shell Programming and Scripting 1 05-07-2009 12:26 PM
UNIX newbie NEWBIE question! Hanamachi UNIX for Dummies Questions & Answers 4 03-28-2009 04:10 PM
Keymapping Issues pb_uvce SCO 0 05-25-2006 05:50 AM
newbie needs help goodman UNIX for Dummies Questions & Answers 1 01-25-2002 09:50 AM



All times are GMT -4. The time now is 05:20 AM.