SHARE
TWEET

Untitled

a guest Jul 20th, 2019 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. map ,ac ggO// Copyright 2019 The Fuchsia Authors. All rights reserved.<CR>Use of this source code is governed by a BSD-style license that can be<CR>found in the LICENSE file.<CR><esc>ddO<esc>
  2.  
  3. function! HeaderGuard()
  4. python << endpython
  5. import vim
  6. name = vim.current.buffer.name
  7. before, sep, main_name = name.rpartition('fuchsia' + os.path.sep)
  8. guard_name = main_name.upper().replace(os.path.sep, '_').replace('.', '_') + '_'
  9. vim.current.buffer.append('#ifndef ' + guard_name + '\n')
  10. vim.current.buffer.append('#define ' + guard_name + '\n')
  11. vim.current.buffer.append('\n')
  12. vim.current.buffer.append('#endif  // ' + guard_name + '\n')
  13. endpython
  14. endfunction
  15.  
  16. map ,hg :call HeaderGuard()<cr>ddjjj
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top