mirror of
https://github.com/amix/vimrc
synced 2025-06-17 10:55:00 +08:00
Updated plugins
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
global !p
|
||||
# Capitalize the first letter without affecting the rest of the letters
|
||||
def capitalize_first(word):
|
||||
if(word):
|
||||
word = word[0].upper() + word[1:]
|
||||
return word
|
||||
endglobal
|
||||
|
||||
# Functional components
|
||||
snippet rfc "react functional component" b
|
||||
import React, {useState} from "react"
|
||||
@ -14,7 +22,7 @@ export default $4`!p snip.rv = snip.basename`
|
||||
endsnippet
|
||||
# React Hooks
|
||||
snippet useS "useState Hook" b
|
||||
const [${1}, set`!p snip.rv=t[1].title()`] = useState(${3:"${4}"})
|
||||
const [${1}, set`!p snip.rv=capitalize_first(t[1])`] = useState(${3:"${4}"})
|
||||
endsnippet
|
||||
snippet useE "useEffect Hook" b
|
||||
useEffect(() => {
|
||||
|
Reference in New Issue
Block a user